<!DOCTYPE HTML>
<!-- saved from url=(0016)http://localhost -->
<!-- This file was generated by [APP NAME] [APP VER] at [GEN DATE] [GEN TIME]. See [APP LINK] for more information -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=10,IE=9,IE=8">
<title>[TITLE]</title>
<style type="text/css">
html, body {
height:100%;
margin: 0;
padding: 0;
}
html > body {
font-size: 16px;
font-size: 68
{
"cells": [
{
"attachments": {
"image.png": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAIjCAYAAADfg2XeAAAgAElEQVR4AeydB5hVxfnG35k5926h994RpIkI2Bs27LHXWGKLsUST2PM3ajTGXmJJLIktxhp77wUVFUFQRAQE6b3D7t57Zub/vMO5y2VZysKyQfab59m99547Z8rvnHvmPd/3zRxAkhAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASE
Linkedin React.Js Assessment Answers
====================================
#### Q1. If you want to import just the Component from the React library, what syntax do you use?
- [ ] `import React.Component from 'react'`
- [ ] `import [ Component ] from 'react'`
- [ ] `import Component from 'react'`
- [x] `import { Component } from 'react'`
#### Q2. If a function component should always render the same way given the same props, what is a simple performance optimization available for it?
-
```
Linkedin Front-End Development Assessment Answers
Front-end Development
Q1. Which image matches the flex layout defined in this style rule?
.container {
display: flex;
}
.container div:last-child {
margin-left: auto;
}
•
•
•
•
Q2. Variables declared with the let keyword have what type of scope?
• function scope
• block scope
• inline scope
• global scope
Q3. Why would you surround a piece of text with <h1></h1> tags?
• to indicate that this text is the main heading on the page
• to make th
# Common Bash Use Cases
# Table of Contents
<!-- vim-markdown-toc GFM -->
- [Common Bash Use Cases](#common-bash-use-cases)
- [Table of Contents](#table-of-contents)
- [STRINGS](#strings)
- [Trim leading and trailing white-space from string](#trim-leading-and-trailing-white-space-from-string)
- [Trim all white-space from string and truncate spaces](#trim-all-white-space-from-string-and-truncate-spaces)
- [Use regex on a string](#use-regex-on-a-string)
- [Split a string on a delimiter]
let fs = require( 'fs' );
let util = require( 'util' );
let log_file = fs.createWriteStream( __dirname + 'consoleOutput.txt', {
flags: 'w'
} );
let log_stdout = process.stdout;
console.log = function ( d ) { //
log_file.write( util.format( d ) + '\n' );
log_stdout.write( util.format( d ) + '\n' );
};
/**
* An asynchronously iterable queue class. Add values with enqueue()
* and remove them with dequeue(). dequeue() returns a Promise, which
* means that values can be dequeued before they are enqueued. The
* class implements [Symbol.asyncIterator] and next() so that it can
* be used with the for/await loop (which will not terminate until
* the close() method is called.)
*/
class AsyncQueue {
constructor() {
// Values that have been queued but not dequeued yet are stored here
th
class Glob {
constructor(glob) {
this.glob = glob;
// We implement glob matching using RegExp internally.
// ? matches any one character except /, and * matches zero or more
// of those characters. We use capturing groups around each.
let regexpText = glob.replace("?", "([^/])").replace("*", "([^/]*)");
// We use the u flag to get Unicode-aware matching.
// Globs are intended to match entire strings, so we use the ^ and $
// anchors and do not implement search
**JavaScript**
- [Mozilla Docs](https://developer.mozilla.org/en/JavaScript/Reference) - only real documentation for JS
- [String](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String)
- [Number](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number)
- [Array](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array)
- [Object](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object)
# _Absolutely Everything You Could Need To Know About How JavaScript_ TOC & Condensed Links
**** | **** | **** | **** | ****
------|------|------|------|------
1 | 2 | 3 | 4 | 5
| [**__leonardomso/33-js-concepts__**\*This repository was created with the intention of helping developers master their concepts in JavaScript. It is not a...\*github.com](https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation "https://github.com/le
[**leonardomso/33-js-concepts**\
*This repository was created with the intention of helping developers master their concepts in JavaScript. It is not a...*github.com](https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation "https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation")[](https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation)
[**Call stack - MDN Web Docs Glossary:
const copyToClipboard = (target) => {
var currentFocus = document.activeElement;
target.select();
target.setSelectionRange(0, target.value.length);
// copy the selection
var succeed;
try {
succeed = document.execCommand("copy");
console.log(succeed);
} catch (e) {
succeed = false;
console.log(e);
}
// restore original focus
if (currentFocus && typeof currentFocus.focus === "function") {
currentFocus.focus();
}
return succeed;
};
# How to download your Udemy course videos using youtube-dl
> $ youtube-dl --list-extractors | grep udemy
## Steps
1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {pat
class Dict:
def __init__(self, capacity=8):
self.storage = [None] * capacity
self.capacity = capacity
self.item_count = 0
def hash(self, string):
bytes = string.encode()
sum = 0
for byte in bytes:
sum += byte
return sum % self.capacity
# def djb2(self, key):
# """
# DJB2 hash, 32-bit
# Implement this, and/or FNV-1.
# """
# str_key = str(key).encode()
# has
# # Is an item in our array? return true or false
def linear_search(arr, target):
for i in range(len(arr)):
if arr[i] == target:
return True
return False
def recursive_search(arr, target):
if len(arr) == 0:
return False
if arr[0] == target:
return True
return recursive_search(arr[1:], target)
def binary_search(array, target):
min = 0
max = len(array) - 1
while min <= max:
# find middle, and check
const join = require("join-path");
const _ = require("lodash");
const INDEX_FILE = "index.html";
const pathutils = {
asDirectoryIndex: (pathname) => {
return pathutils.isDirectoryIndex(pathname)
? pathname
: join(pathname, INDEX_FILE);
},
isDirectoryIndex: (pathname) => {
return _.endsWith(pathname, "/" + INDEX_FILE);
},
hasTrailingSlash: (pathname) => {
return _.endsWith(pathname, "/");
},
addTrailingSlash: (pathname) => {
return pathutils.hasTrail
# **Notes**
# **Notes**
## **Random Things to Remember**
- Using `()` implicity returns components.
- Role of `index.js` is to _render_ your application.
- The reference to `root` comes from a div in the body of your public html file.
- State of a component is simply a regular JS Object.
- Class Components require `render()` method to return JSX.
- Functional Components directly return JSX.
- `Class` is `className` in React.
- When parsing for an integer just chain `Number.parseInt("123")`
- Use
export default class Wallet {
// ...
}
// sayHello will not be exported
function sayHello() {
console.log("Hello!");
}
function PeopleList(props) {
return (
<ul>
$
{props.people.map((person) => (
<li>
{person.lastName}, {person.firstName}
</li>
))}
</ul>
);
}
const peopleListElement = document.querySelector("#people-list");
fetch("https://example.com/api/people")
.then((response) => response.json())
.then((people) => {
const props = { people };
ReactDOM.render(<PeopleList props={props} />, peopleListElement);
});
Git is a distributed version control and source code management system.
It does this through a series of snapshots of your project, and it works
with those snapshots to provide you with functionality to version and
manage your source code.
## Versioning Concepts
### What is version control?
Version control is a system that records changes to a file(s), over time.
### Centralized Versioning vs. Distributed Versioning
* Centralized version control focuses on synchronizing, tracking, and back
JavaScript was created by Netscape's Brendan Eich in 1995. It was originally
intended as a simpler scripting language for websites, complementing the use of
Java for more complex web applications, but its tight integration with Web pages
and built-in support in browsers has caused it to become far more common than
Java in web frontends.
JavaScript isn't just limited to web browsers, though: Node.js, a project that
provides a standalone runtime for Google Chrome's V8 JavaScript engine, is
becomi
jQuery is a JavaScript library that helps you "do more, write less". It makes many common JavaScript tasks and makes them easier to write. jQuery is used by many big companies and developers everywhere. It makes AJAX, event handling, document manipulation, and much more, easier and faster.
Because jQuery is a JavaScript library you should [learn JavaScript first](https://learnxinyminutes.com/docs/javascript/)
**NOTE**: jQuery has fallen out of the limelight in recent years, since you can achie
JSON is an extremely simple data-interchange format. As [json.org](https://json.org) says, it is easy for humans to read and write and for machines to parse and generate.
A piece of JSON must represent either:
* A collection of name/value pairs (`{ }`). In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
* An ordered list of values (`[ ]`). In various languages, this is realized as an array, vector, list, or sequence.
Markdown also varies in implementation from one parser to a next. This
guide will attempt to clarify when features are universal or when they are
specific to a certain parser.
- [HTML Elements](#html-elements)
- [Headings](#headings)
- [Simple Text Styles](#simple-text-styles)
- [Paragraphs](#paragraphs)
- [Lists](#lists)
- [Code blocks](#code-blocks)
- [Horizontal rule](#horizontal-rule)
- [Links](#links)
- [Images](#images)
- [Miscellany](#miscellany)
## HTML Elements
Markdown is a superset
# Python:
```py
# Single line comments start with a number symbol.
""" Multiline strings can be written
using three "s, and are often used
as documentation.
"""
####################################################
## 1. Primitive Datatypes and Operators
####################################################
# You have numbers
3 # => 3
# Math is what you would expect
1 + 1 # => 2
8 - 1 # => 7
10 * 2 # => 20
35 / 5 # => 7.0
# Integer division rounds down for both positive and n
Web pages are built with HTML, which specifies the content of a page.
CSS (Cascading Style Sheets) is a separate language which specifies
a page's **appearance**.
CSS code is made of static *rules*. Each rule takes one or more *selectors* and
gives specific *values* to a number of visual *properties*. Those properties are
then applied to the page elements indicated by the selectors.
This guide has been written with CSS 2 in mind, which is extended by the new
features of CSS 3.
**NOTE:** Becau
Bash is a name of the unix shell, which was also distributed as the shell
for the GNU operating system and as the default shell on most Linux distros.
Nearly all examples below can be a part of a shell script
or executed directly in the shell.
[Read more here.](https://www.gnu.org/software/bash/manual/bashref.html)
```bash
#!/usr/bin/env bash
# First line of the script is the shebang which tells the system how to execute
# the script: https://en.wikipedia.org/wiki/Shebang_(Unix)
# As you alrea
TypeScript is a language that aims at easing development of large scale
applications written in JavaScript. TypeScript adds common concepts such as
classes, modules, interfaces, generics and (optional) static typing to
JavaScript. It is a superset of JavaScript: all JavaScript code is valid
TypeScript code so it can be added seamlessly to any project. The TypeScript
compiler emits JavaScript.
This article will focus only on TypeScript extra syntax, as opposed to
[JavaScript](/docs/javascrip
// Step By Step
function FirstReverse(str) {
// First, we need to use .split to change the string into an array so it can be further manipulated.
// Passing "" (an empty string) into the method splits the string at every character.
str = str.split("");
// Next, we use the reverse method to reverse the order of the elements in our newly formed array.
// Note that only arrays have the .reverse method, which is why we had to use .split.
str = str.reverse();
// After that, we use the
Getting started
---------------
{: .-three-column}
### Introduction
{: .-intro}
This is a quick reference to getting started with Bash scripting.
- [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
- [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
### Example
```bash
#!/usr/bin/env bash
NAME="John"
echo "Hello $NAME!"
```
### Variables
```bash
NAME="John"
echo $NAME
echo "$NAME"
echo "${NAME}!"
```
### String quotes
---
title: Bootstrap
layout: 2017/sheet
prism_languages: [scss, haml, html]
weight: -1
category: CSS
description: |
.container .row .col-md-6, @screen-sm-min, .form-control, grids, .modal-content, tooltips, and other Bootstrap CSS examples.
---
### Screen sizes
```
768 992 1200
' ' ' ' ' ' ' ' '
<---------^------------^------------------^--------->
xs sm md lg
(phone) (tablet) (
#!/bin/bash
##############################################################################
# SHORTCUTS and HISTORY
##############################################################################
CTRL+A # move to beginning of line
CTRL+B # moves backward one character
CTRL+C # halts the current command
CTRL+D # deletes one character backward or logs out of current session, similar to exit
CTRL+E # moves to end of line
CTRL+F # moves forward one character
CTRL+G # aborts the current editing
/* *******************************************************************************************
* SYNOPSIS
* http://nodejs.org/api/synopsis.html
* ******************************************************************************************* */
var http = require('http');
// An example of a web server written with Node which responds with 'Hello World'.
// To run the server, put the code into a file called example.js and execute it with the node program.
http.createServer(function (request, re
/* *******************************************************************************************
* REACT.JS CHEATSHEET
* DOCUMENTATION: https://reactjs.org/docs/
* FILE STRUCTURE: https://reactjs.org/docs/faq-structure.html
* ******************************************************************************************* */
```
npm install --save react // declarative and flexible JavaScript library for building UI
npm install --save react-dom // serves as the entry point of the DOM-relate
/* *******************************************************************************************
* GLOBAL OBJECTS > OBJECT
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
* ******************************************************************************************* */
// Global object: properties
Object.length // length is a property of a function object, and indicates how many arguments the function expects, i.e.
# JavaScript Cheat Sheet
> JavaScript methods and functions, a guide to regular expressions and the XMLHttpRequest object.
### Regular Expressions Syntax
<table id="cheat_sheet_output_table"><tbody><tr><td><p>^</p></td><td><p>Start of string</p></td></tr><tr><td><p>$</p></td><td><p>End of string</p></td></tr><tr><td><p>.</p></td><td><p>Any single character</p></td></tr><tr><td><p>(a|b)</p></td><td><p>a or b</p></td></tr><tr><td><p>(...)</p></td><td><p>Group section</p></td></tr><tr><td><p>[a
async function hello() {
return (greeting = await Promise.resolve("Hello"));
}
hello().then(alert);
const Clock = (props) => {
return (
<div>
<h1>Clock</h1>
<div className="clock">
<p>
<span>Time:</span>
<span>
{props.hours}:{props.minutes}:{props.seconds}
</span>
</p>
</div>
</div>
);
};
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
document.getElementsByTagName("html")[0].className = "js";
</script>
</head>
<body>
<div class="wrapper">
<div class="item">
<div class="iframe">
<iframe s
function RecurseDirs ()
{
oldIFS=$IFS
IFS=$'\n'
for f in "$@"
do
# YOUR CODE HERE!
find ./ -iname "*.md" -maxdepth 1 -type f -exec sh -c 'pandoc --standalone "${0}" -o "${0%.md}.html"' {} \;
if [[ -d "${f}" ]]; then
cd "${f}"
RecurseDirs $(ls -1 ".")
cd ..
fi
done
IFS=$oldIFS
}
RecurseDirs "./"
# Recursively remove lines of text containing the string badFolder from files in the working directory.
find . -type f -exec sed -i '/badFolder/d' ./* {} \;
wget -r -A.pdf https://overapi.com/gitwget --wait=2 --level=inf --limit-rate=20K --recursive --page-requisites --user-agent=Mozilla --no-parent --convert-links --adjust-extension --no-clobber -e robots=off
#!/bin/sh
# find ./ | grep -i "\.\*$" >files
find ./ | sed -E -e 's/([^ ]+[ ]+){8}//' | grep -i "\.\*$">files
listing="files"
out=""
html="index.html"
out="basename $out.html"
html="index.html"
cmd() {
echo ' <!DOCTYPE html>'
echo '<html>'
echo '<head>'
echo ' <meta http-equiv="Content-Type" content="text/html">'
echo ' <meta name="Author" content="Bryan Guner">'
echo '<link rel="stylesheet" href="./assets/prism.css">'
echo ' <link rel="stylesheet" href="./assets/style.css">'
echo ' <script as
# Recursivley delete empty files.
find . -empty -type f -print -delete
npm i -g recursive-install
npm-recursive-install
# Recursively unzip zip files and then delete the archives when finished
sudo apt install unzip
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
find . -name "*.zip" -type f -print -delete
ReactDOM.render(
component, // The react component to render
target // the browser DOM node to render it to
);
var saveAs = saveAs
// IE 10+ (native saveAs)
|| (typeof navigator !== "undefined" &&
navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
// Everyone else
|| (function(view) {
"use strict";
// IE <10 is explicitly unsupported
if (typeof navigator !== "undefined" &&
/MSIE [1-9]\./.test(navigator.userAgent)) {
return;
}
var
doc = view.document
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
, get_URL = functio
### Table of Contents
1. **[Start Here](#start-here)**
2. **[How to learn](#how-to-learn)**
3. **[What is the Most Useful CS Bookmark You have](#what-is-the-single-most-useful-cs-bookmark-you-have)**
4. **[Programs & Classes](#programs-and-classes)**
5. **[Learn HTML](#learn-html)**
6. **[Learn CSS](#learn-css)**
7. **[Learn JavaScript](#learn-javascript)**
8. **[Learn React.js](#learn-react-js)**
9. **[Full Stack Tutorials](#full-stack-tutorials)**
10. **[Learn Node.js](#learn-node-js)**
11. *
############
# This script will add your WSL environments to the Windows Defender exclusion list so that
# realtime protection does not have an adverse effect on performance.
#
# You should be aware that this could make your system less secure. Use at your own risk.
# Note: This should be run from an administrative PowerShell prompt
############
# Find registered WSL environments
$wslPaths = (Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | ForEach-Object { Get-ItemProperty
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Setup (please run this cell first)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install ipykernel\r\n",
"!pip install numpy\r\n",
"!pip install pandas\r\n",
"!pip install matplotlib\r\n",
"!pip install bokeh\r\n",
"!pip install seaborn\r\n",
"!pip install altair\r\n",
"!pip install vega_datasets\r\n"
All the codes are written and run on `psql`
I would be adding many stuffs as I learn them. There is no particular order in which I add the contents.
I'm using the following postgres version:
```
SELECT version();
version
----------------------------------------------------------------------------------------------------------------
PostgreSQL 9.6.2 on x86_64-apple-darwin16.4.0, compiled
// -- updated in 2020/04/19 covering the issues in the comments to this point
// -- remember you also have things like `ensureDirSync` from https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir-sync.md
const fs = require('fs')
function writeFileSyncRecursive(filename, content, charset) {
// -- normalize path separator to '/' instead of path.sep,
// -- as / works in node for Windows as well, and mixed \\ and / can appear in the path
let filepath = filename.replace(/\\/g
function spliceOne(list, index) {
for (; index + 1 < list.length; index++)
list[index] = list[index + 1];
list.pop();
}
ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original));
ObjectDefineProperty(fn, kCustomPromisifiedSymbol, {
value: fn, enumerable: false, writable: false, configurable: true
});
return ObjectDefineProperties(
fn,
ObjectGetOwnPropertyDescriptors(original)
);
}
'use strict';
function init(list) {
list._idleNext = list;
list._idlePrev = list;
}
// Show the most idle item.
function peek(list) {
if (list._idlePrev === list) return null;
return list._idlePrev;
}
// Remove an item from its list.
function remove(item) {
if (item._idleNext) {
item._idleNext._idlePrev = item._idlePrev;
}
if (item._idlePrev) {
item._idlePrev._idleNext = item._idleNext;
}
item._idleNext = null;
item._idlePrev = null;
}
// Remove an item from its
'use strict';
const {
Array,
ArrayPrototypeJoin,
ArrayPrototypeMap,
ArrayPrototypePush,
ArrayPrototypeReduce,
ArrayPrototypeSlice,
FunctionPrototypeBind,
Int8Array,
Number,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectGetOwnPropertySymbols,
ObjectGetPrototypeOf,
ObjectKeys,
ReflectApply,
ReflectGetOwnPropertyDescriptor,
ReflectOwnKeys,
RegExpPrototypeExec,
String,
StringPrototypeCharCodeAt,
StringPrototypeIncludes,
StringPrototy
function commonPrefix(strings) {
if (strings.length === 1) {
return strings[0];
}
const sorted = ArrayPrototypeSort(ArrayPrototypeSlice(strings));
const min = sorted[0];
const max = sorted[sorted.length - 1];
for (let i = 0; i < min.length; i++) {
if (min[i] !== max[i]) {
return StringPrototypeSlice(min, 0, i);
}
}
return min;
}
<iframe width="100%" height="300" src="//jsfiddle.net/bgoonz/h6wezn5k/2/embedded/result/dark/" allowfullscreen="allowfullscreen" allowpaymentrequest frameborder="0"></iframe>
<!-- CCPA Opt-Out by https://www.TermsFeed.com -->
<script type="text/javascript" src="//www.termsfeed.com/public/ccpa-opt-out/releases/1.0.0/ccpa-opt-out.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
ccpa_optout.run({"banner_style":"notice","banner_color_palette":"dark","banner_title":"Do Not Sell My Information","banner_description":"Turning this off will opt you out of personalized advertisements on this website.","banner_category_la
<!-- Cookie Consent by https://www.TermsFeed.com -->
<script type="text/javascript" src="//www.termsfeed.com/public/cookie-consent/4.0.0/cookie-consent.js" charset="UTF-8"></script>
<script type="text/javascript" charset="UTF-8">
document.addEventListener('DOMContentLoaded', function () {
cookieconsent.run({"notice_banner_type":"simple","consent_type":"implied","palette":"light","language":"en","page_load_consent_levels":["strictly-necessary","functionality","tracking","targeting"],"notice_banne
<!DOCTYPE html>
<html>
<head>
<title>Locator</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
<script src="https://www.gstatic.com/external_hosted/handlebars/v4.7.6/handlebars.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
<html lang="en" class="studio-page-html" data-react-helmet="class">
<canvas
style="
inset: 0px;
pointer-events: none;
position: fixed;
z-index: 1000000000;
"
width="1140"
height="1002"
></canvas
><head>
<style data-merge-styles="true"></style>
<style data-merge-styles="true"></style>
<meta charset="UTF-8" />
<meta name="google" content="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link
Cheap AI Chess!
---------------
A wonderful opportunity to beat a computer at chess!
Play against a friend, a totally random AI, or wager money as it plays against itself. I'm sure there are still bugs in here but hey, happy new year.
A [Pen](https://codepen.io/bgoonz/pen/zYZVYMj) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/zYZVYMj/license).
<header id="intro">
<section>
<h1>Procedurally Generated Music</h1>
<p>
This will infinitely generate a random song based on the <em>seed</em> that you provide it with.
Procedural generation ensures that the song will always be the exact
same song for the seed data you provide, but will be unique to any other seed.
</p>
<p>
Type anything into the input below and hit "Load" to generate and hear your song.
</p>
<input id="seed" type="text" placeh
<article>
<aside id="aside"></aside>
<main id="main"></main>
</article>
# GraphQL Workshop
Welcome! We're really glad you're here! Below you'll find all of the resources that we'll use throughout this course. If you're looking for slides, samples, links, etc., this is the place to look.
## Instructor Info
- **Eve Porcello**: [Twitter](https://twitter.com/eveporcello) | [Email](mailto:eve@moonhighway.com)
- **Alex Banks**: [Twitter](https://twitter.com/moontahoe) | [Email](mailto:alex@moonhighway.com)
- **Moon Highway Training**: [Moon Highway Website](https://ww
import PropTypes from 'prop-types'
import React from 'react'
import Fieldset from 'part:@sanity/components/fieldsets/default'
import {setIfMissing} from 'part:@sanity/form-builder/patch-event'
import {FormBuilderInput} from 'part:@sanity/form-builder'
import filterFieldFn$ from 'part:@sanity/desk-tool/filter-fields-fn?'
export default class CustomObjectInput extends React.PureComponent {
static propTypes = {
type: PropTypes.shape({
title: PropTypes.string,
name: PropTypes.stri
// This script will find and delete all assets that are not referenced (in use)
// by other documents. Sometimes refered to as "orphaned" assets.
//
// Place this script somewhere and run it through
// `sanity exec <script-filename.js> --with-user-token`
/* eslint-disable no-console */
import client from 'part:@sanity/base/client'
const query = `
*[ _type in ["sanity.imageAsset", "sanity.fileAsset"] ]
{_id, "refs": count(*[ references(^._id) ])}
[ refs == 0 ]
._id
`
client
.fetch(qu
{
"installDependencies": true,
"startCommand": "npm start"
}
Fourier [css] Transform
-----------------------
Better version: http://codepen.io/pavlovsk/pen/aWGGgW/left/
Inspired by this gif:  from [Fourier Transform @ Wikipedia](https://en.wikipedia.org/wiki/Fourier_transform)
A [Pen](https://codepen.io/bgoonz/pen/BaWEVqg) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoo
https://github.com/RedHatOfficial/RedHatOfficial.github.io
https://github.com/RedHatOfficial/RedHatOfficial.github.io/stargazers
https://github.com/RedHatOfficial/RedHatOfficial.github.io/network/members
https://github.com/cfpb/cfpb.github.io
https://github.com/cfpb/cfpb.github.io/stargazers
https://github.com/cfpb/cfpb.github.io/network/members
https://github.com/Netflix/netflix.github.com
https://github.com/Netflix/netflix.github.com/stargazers
https://github.com/Netflix/netflix.github.com/net
Name Bryan Guner
Profile https://www.facebook.com/bryan.guner
Registration Date Thursday, August 27, 2009 at 2:05 PM UTC-04:00
Emails
bryan.guner@gmail.com
gunerb1@tcnj.edu
bryan.guner@facebook.com(Previous Email)
Birthday Jan 25, 1994
Gender Male
Current City New Brunswick, New Jersey
Hometown Fair Lawn, New Jersey
Relationship Status In a civil union (Jun 6, 2015, 4:30 PM)
Previous Relationships
Adam Sarkisian
Claudia Moskal
Family
Kathy Clum Guner (Mother) (Feb 13, 2021, 2:32 PM)
Barbara L
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<meta name="Author" content="Bryan Guner">
<TITLE>Static Server Directory</TITLE>
</head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
<!------------------------
#!bin/bash
sudo apt install rename
find . -name "* *" -type d | rename 's/ /_/g' # do the directories first
find . -name "* *" -type f | rename 's/ /_/g'
#!/bin/bash
sudo apt install unzip
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
# then delete the zip files
find . -name "*.zip" -type f -print -delete
const axios = require('axios');
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
// Optionally the request above could also be done as
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
console.log(response);
})
.
This is a small collection of scripts showing how to use require.js. It's only one of several ways of setting up a require.js project, but it's enough to get started.
At its core, require.js is about three things:
1. Dependency management
2. Modularity
3. Dynamic script loading
The following files show how these are achieved.
(You can see this code in action here: http://williambowers.net/sandbox/requirejs/)
<a href="https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fhello-world"><img src="https://vercel.com/button" alt="Deploy with Vercel"/></a>
Basics
PEP8 : Python Enhancement Proposals, style-guide for Python.
print is the equivalent of console.log.
# is used to make comments in your code.
def foo(): """ The foo function does many amazing things that you should not question. Just accept that it exists and use it with caution. """ secretThing()
Python has a built in help function that let’s you see a description of the source code without having to navigate to it.
Numbers
Python has three types of numbers:
Integer
Positive and N
function recurBSearch(array, target) {
if (array.length === 0) {
return false;
}
const midIdx = Math.floor(array.length / 2);
const midEl = array[midIdx];
const leftHalf = array.slice(0, midIdx);
const rightHalf = array.slice(midIdx + 1);
if (target < midEl) {
return recurBSearch(leftHalf, target);
} else if (target > midEl) {
return recurBSearch(rightHalf, target);
} else {
return true;
}
}
function iterBSearch(array, target) {
let lowerIdx = 0;
let upper
let fs = require('fs')
let path = require('path')
function read(root, filter, files, prefix) {
prefix = prefix || '';
files = files || [];
let dir = path.join(root, prefix)
if (!fs.existsSync(dir)) return files
if (fs.statSync(dir).isDirectory())
fs.readdirSync(dir).forEach(function (name) {
read(root, filter, files, path.join(prefix, name))
})
else
files.push(prefix)
return files
}
//-------------------(testing)------------------------
let files = read( pa
module.exports = function flatten(list, depth) {
depth = (typeof depth == 'number') ? depth : Infinity;
if (!depth) {
if (Array.isArray(list)) {
return list.map(function(i) { return i; });
}
return list;
}
return _flatten(list, 1);
function _flatten(list, d) {
return list.reduce(function (acc, item) {
if (Array.isArray(item) && d < depth) {
return acc.concat(_flatten(item, d + 1));
}
else {
return acc.concat(item);
}
# bgoonz/BGOONZ_BLOG_2.0
> The new home of my blog/resource sharing website. Contribute to bgoonz/BGOONZ_BLOG_2.0 development by creating an account on GitHub.
* Watch
### Notifications
<button>
<input name="authenticity\_token"> <input name="repository\_id"> <button name="do" value="included"> <button name="do" value="subscribed"> <button name="do" value="ignore">
<button>
[1](chrome-extension://cjedbglnccaioiolemnfhjncicchinao/bgoonz/BGOONZ_BLOG
- [/blog/](https://preview--best-celery-b2d7c.stackbit.dev/blog/)
- [/docs/](https://preview--best-celery-b2d7c.stackbit.dev/docs/)
- [/docs/portfolio-web/](https://preview--best-celery-b2d7c.stackbit.dev/docs/portfolio-web/)
- [/docs/python/](https://preview--best-celery-b2d7c.stackbit.dev/docs/python/)
- [/docs/about/](https://preview--best-celery-b2d7c.stackbit.dev/docs/about/)
- [/docs/about/resume/](https://preview--best-celery-b2d7c.stackbit.dev/docs/about/resume/)
- [/docs/f
C:/WINDOWS/System32/wsl.exe
-----------------------------------------ZIP UTILS-----------------------------------------------------------------------------------------
4.)Recursive-unzip:()===>
find . -name "*.zip" | while read filename; do unzip -o -d "`dirname "$filename"`" "$filename"; done;
find . -name "*.zip" -type f -print -delete
---------------------------------------------------------------------------------------------------------
Install node modules recursevly (npm i -g recurs
<!-- start of freefind search box html -->
<table cellpadding=0 cellspacing=0 border=0 >
<tr>
<td style="font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt;">
<center><table width="90%" cellpadding=0 cellspacing=0 border=0 style="font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt;">
<tr>
<td style="font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt;" align=left ><a href="https://search.freefind.com/siteindex.html?si=79970144">index</a></td>
<td style="font
/* *******************************************************************************************
* REACT.JS CHEATSHEET
* DOCUMENTATION: https://reactjs.org/docs/
* FILE STRUCTURE: https://reactjs.org/docs/faq-structure.html
* ******************************************************************************************* */
```
npm install --save react // declarative and flexible JavaScript library for building UI
npm install --save react-dom // serves as the entry point of the DOM-relate
import React from 'https://cdn.skypack.dev/react';
import ReactDOM from 'https://cdn.skypack.dev/react-dom';
function Navbar() {
return (
<div className="p-8 w-full h-full flex items-center justify-center">
<div className="w-full border dark:border-gray-800 flex items-center justify-between shadow-lg">
<div className="p-4">
<a href="#" className="text-xl font-bold">
Title
</a>
</div>
<div className="flex p-2 text-sm font-semibo
<div class="powr-social-feed" id="sharethis-social-feed-60c2b3f20cb9f200113df1c3"></div><script src="https://www.powr.io/powr.js?platform=html"></script>
# React.js cheatsheet
> React.Component · render() · componentDidMount() · props/state · dangerouslySetInnerHTML · React is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
[React](https://reactjs.org/) is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
# React Cheat Sheet
render
------
render() {
return <div />;
}
constructor
-----------
```js
constructor(props) {
super(props);
t
import { Route, Switch } from "react";
import Home from "./components/Home";
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route exact path="/users">
<Users />
</Route>
</Switch>;
// ./src/index.js
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import App from "./App";
const Root = () => {
return (
<BrowserRouter>
<App />
</BrowserRouter>
);
};
ReactDOM.render(
<React.StrictMode>
{" "}
<Root />{" "}
</React.StrictMode>,
document.getElementById("root")
);
node_modules/
<p>Renders an accordion menu with multiple collapsible content elements.</p>
<ul>
<li>Define an <code>AccordionItem</code> component, that renders a <code><button></code> which is used to update the component and notify its parent via the <code>handleClick</code> callback.</li>
<li>Use the <code>isCollapsed</code> prop in <code>AccordionItem</code> to determine its appearance and set an appropriate <code>className</code>.</li>
<li>Define an <code>Accordion</code> component that uses the <c
<iframe id="editor" src="https://embed.spck.io/?files=1&preview=1"
allow="geolocation; microphone; camera; midi; encrypted-media"
style="height: 800px; width: 90%; border: 0;"></iframe>
<!--Load library-->
<script src="https://embed.spck.io/embed/spck-embed.min.js"></script>
```js
const HSBToRGB = (h, s, b) => {
s /= 100;
b /= 100;
const k = (n) => (n + h / 60) % 6;
const f = (n) => b * (1 - s * Math.max(0, Math.min(k(n), 4 - k(n), 1)));
return [255 * f(5), 255 * f(3), 255 * f(1)];
};
```
```js
HSBToRGB(18, 81, 99); // [252.45, 109.31084999999996, 47.965499999999984]
```
```js
const HSLToRGB = (h, s, l) => {
s /= 100;
l /= 100;
const k = n => (n + h / 30) % 12;
const a = s * Math.min(l, 1 - l);
const f = n =>
l - a * Math.max(-1, Math.min(k(n
- [Official](#official)
- [Packages](#packages)
- [Mad science](#mad-science)
- [Command-line apps](#command-line-apps)
- [Functional programming](#functional-programming)
- [HTTP](#http)
- [Debugging / Profiling](#debugging--profiling)
- [Logging](#logging)
- [Command-line utilities](#command-line-utilities)
- [Build tools](#build-tools)
- [Hardware](#hardware)
- [Templating](#templating)
- [Web frameworks](#web-frameworks)
- [Documentation](#documentation)
- [Filesystem](#filesys
[links.md](https://raw.githubusercontent.com/bgoonz/BGOONZ_BLOG_2.0/master/notes/links.md)
[my-website-links.md](https://raw.githubusercontent.com/bgoonz/BGOONZ_BLOG_2.0/master/notes/my-website-links.md)
[my-websites.md](https://raw.githubusercontent.com/bgoonz/BGOONZ_BLOG_2.0/master/notes/my-websites.md)
[scrap.md](https://raw.githubusercontent.com/bgoonz/BGOONZ_BLOG_2.0/master/notes/scrap.md)
[test.md](https://raw.githubusercontent.com/bgoonz/BGOONZ_BLOG_2.0/master/notes/test.md)
[medium/A-Col
import React from "react";
import "./styles.css";
function FirstComponent({ children }) {
return (
<div>
<h3>I am the first component</h3>;
{ children }
</div>
);
}
function SecondComponent({ children }) {
return (
<div>
<h3>I am the second component</h3>;
{children}
</div>
);
}
function ThirdComponent({ children }) {
return (
<div>
<h3>I am the third component</h3>
{children}
</div>
);
}
function ComponentNeedingProps({
import React from "react";
import "./styles.css";
export default function App() {
return (
<div className="App">
<FirstComponent content="Who needs me?" />
</div>
);
}
function FirstComponent({ content }) {
return (
<div>
<h3>I am the first component</h3>;
<SecondComponent content={content} />|
</div>
);
}
function SecondComponent({ content }) {
return (
<div>
<h3>I am the second component</h3>;
<ThirdComponent content={content} />
## Appearance
The outward or visible aspect of a website.
+ **Animation**: The process of creating motion and shape change.
+ **[Animate.css](http://daneden.github.io/animate.css/)**: Just-add-water CSS animations.
+ **[Animate.less](https://github.com/machito/animate.less)**: A bunch of cool, fun, and cross-browser animations converted into LESS for you to use in your Bootstrap projects.
+ **[Anime.js](https://github.com/juliangarnier/anime)**: Anime is a flexible yet lightweight
! function ( e, t ) {
for ( var n in t ) e[ n ] = t[ n ]
}( exports, function ( e ) {
var t = {};
function n( o ) {
if ( t[ o ] ) return t[ o ].exports;
var r = t[ o ] = {
i: o,
l: !1,
exports: {}
};
return e[ o ].call( r.exports, r, r.exports, n ), r.l = !0, r.exports
}
return n.m = e, n.c = t, n.d = function ( e, t, o ) {
n.o( e, t ) || Object.defineProperty( e, t, {
enumerable: !0,
get: o
} )
}, n.r = function ( e ) {
"und
https://medium.com/@me_37286/20-ways-to-become-a-better-node-js-developer-in-2020-d6bd73fcf424)
https://twitter.com/thekitze/status/1207718292149952512)
https://twitter.com/mtliendo/status/1215382381026316290)
https://www.heroku.com/podcasts/codeish/51-best-practices-in-error-handling
https://www.stefanjudis.com/today-i-learned/npm-init-uses-npx-under-the-hood
https://joshtronic.com/2021/01/17/recursively-create-directories-with-nodejs
https://github.com/danbev/learning-nodejs)
https://blog.s1h.
# ✨ Libris Nextjs Theme ✨
This is Stackbit's "Libris" theme built with [Next.js](https://nextjs.org/) and
powered by content stored in files.
Click the button below to create a new website from this theme using Stackbit:
<p align="center">
<a href="https://app.stackbit.com/create?theme=https://github.com/stackbit-themes/libris-nextjs&utm_source=theme-readme&utm_medium=referral&utm_campaign=stackbit_themes"><img alt="Create with Stackbit" src="https://assets.stackbit.com/badge/create-with-st
$( document ).ready( function () {
jQuery( ".picker-btn" ).click( function () {
"0px" == jQuery( ".color-picker" ).css( "right" ) ? jQuery( ".color-picker" ).animate( {
right: "-223px"
}, "slow" ) : jQuery( ".color-picker" ).animate( {
right: "0px"
}, "slow" )
} ), setTimeout( function () {
jQuery( ".color-picker" ).animate( {
right: "-223px"
}, "slow" )
}, 4e3 );
var a = "paletteoriginal";
$( "body" ).addClass( a ), $( ".picker-original" ).click(
function ansiTrim (str) {
var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
'\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g')
return str.replace(r, '')
}
module.exports = ansiTrim
|
|
Hey Bryan, it's Nate from [newline](https://fd338.infusion-links.com/api/v1/click/6626750413275136/5065786733756416) and today I'll show you how to create a PostgreSQL database for your AWS Lambda app. In this walkthrough, we configure the database so that it's covered by the AWS [Free Tier](https://fd338.infusion-links.com/api/v1/click/5815833194790912/5065786733756416), that way it won't cost anything.
This lesson is part of *The newline Guide to Serverless Django with Zappa*. Check out
export default function () {
// function to scroll up to page top
const PageTopBtn = document.getElementById('js-scroll-top')
if (!PageTopBtn) return
PageTopBtn.addEventListener('click', (e) => {
window.scrollTo({
top: 0,
behavior: 'smooth'
})
})
// show scroll button only when display is scroll down
window.addEventListener('scroll', function () {
const y = document.documentElement.scrollTop // get the height from page top
if (y < 100) {
PageTopB
function NavLinks({ hello, color }) {
return (
<ul>
<li>
<a href='/hello'>{hello}</a>
</li>
<li className='selected'>
<a href='/pets'>Pets</a>
</li>
<li>
<a href='/owners'>Owners</a>
</li>
</ul>
);
}
function NavLinks(props) {
return (
<ul>
<li>
<a href='/hello'>{props.hello}</a>
</li>
<li className='selected'>
<a href='/pets'>Pets</a>
</li>
<li>
<a href='/owners'>Owners</a>
</li>
</ul>
);
}
function NavBar() {
const world = 'world';
return (
<nav>
<h1>Pet App</h1>
//props passes as a variable
<NavLinks hello={world} />
</nav>
);
}
function NavBar() {
return (
<nav>
<h1>Pet App</h1>
// props being passed in component
<NavLinks hello='world' />
</nav>
);
}
function AlertButton() {
showAlert = () => {
window.alert('Button clicked!');
};
return (
<button type='button' onClick={showAlert}>
Click Me
</button>
);
}
export default AlertButton;
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
const navBar = (
<nav>
<ul>
<li>Home</li>
<li>Profile</li>
<li>Settings</li>
</ul>
</nav>
);
const hello = <h1>Hello World!</h1>;
### Hi there 👋
- 🔭 I’m currently working on JS, Python
- 🌱 I’m currently learning Advanced Typescript & Go
- 🤔 I’m looking for & am uptodate with Frontend Everything
- 👯 I’m looking to work with Ambitious Developers
- 💬 Ask me about Fullstack in Node, Python, and Typescript
- 📫 How to reach me: google -> ahmadalibaloch
- 😄 Pronouns: Runner, Chess Player, Abstract, MultiDomain
- ⚡ Fun fact: Writing a book "The Unlocking", to grow original humans on earth free from cultural, childhood, family and
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE `compositions` (
`id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`iduser` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
`public` tinyint(1) NOT NULL DEFAULT '1',
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`duration` smallint(6) NOT NULL,
`bpm` smallint(6) NOT NULL,
`beatsPerMeasure` tinyint(4) NOT NULL,
`stepsPerBeat` tinyint(4) NOT NULL,
`data` json NOT NULL,
`created` datetime NO
#!/bin/bash
declare -a HEADER=(
'<!DOCTYPE html>'
'<html lang="en">'
'<head>'
'<title>GridSound</title>'
'<meta charset="UTF-8"/>'
'<meta name="viewport" content="width=device-width, user-scalable=no"/>'
'<meta name="description" content="A free and Open-Source DAW (digital audio workstation)"/>'
'<meta name="google" content="notranslate"/>'
'<meta property="og:type" content="website"/>'
'<meta property="og:title" content="GridSound"/>'
'<meta property="og:url" content="https://grids
---
title: Bryan Guner Web Dev Resource Hub
sections:
- section_id: hero
type: section_hero
title: I am a musician/electrical engineer turned web developer
image: images/3.jpg
content: "###### **A passionate frontend developer from New Jersey U.S.A**\n\n[](https://www.vagrantup.com/)[](mailto:bryan.guner@gmail.com)[](https://www.youtube.com/channel/UC9-rYyUMsnEBK8G8fCyrXX
// --- Directions
// 1) Implement the Node class to create
// a binary search tree. The constructor
// should initialize values 'data', 'left',
// and 'right'.
// 2) Implement the 'insert' method for the
// Node class. Insert should accept an argument
// 'data', then create an insert a new node
// at the appropriate location in the tree.
// 3) Implement the 'contains' method for the Node
// class. Contains should accept a 'data' argument
// and return the Node in the tree with the same value.
var fs = require('fs');
var path = require('path');
var json = require("../package.json");
var match = json.name.match(/^@runkit\/(.*)_(.*)$/);
// check if our module name actually makes sense, otherwise abort
if (!match) throw new Error("Unknown package structure!");
// check if we're actually inside a node_modules/@runkit folder, otherwise don't create symlinks
if (path.basename(path.dirname(process.cwd())) !== "@runkit" || path.basename(path.dirname(path.dirname(process.cwd()))) !== "node_
class TreeNode {
constructor(val) {
this.val = val;
this.left = null;
this.right = null;
}
}
let a = new TreeNode('a');
let b = new TreeNode('b');
let c = new TreeNode('c');
let d = new TreeNode('d');
let e = new TreeNode('e');
let f = new TreeNode('f');
a.left = b;
a.right = c;
b.left = d;
b.right = e;
c.right = f;
function inOrderPrint(root) {
if (!root) return;
inOrderPrint(root.left);
console.log(root.val);
inOrderPrint(root.right);
}
let tree1 = new BST();
tree1
{
"user": {
"id": 45455,
"name": "Bryan C Guner",
"email": "bryan.guner@gmail.com",
"image": "https://avatars.githubusercontent.com/u/66654881?v=4",
"nickname": "bgoonz",
"provider": "github"
},
"personalLibrary": {
"id": 49329,
"guid": "9329f0ac24e8b6ec1373",
"createdAt": "2021-05-02T06:26:00Z",
"updatedAt": "2021-05-23T22:32:16Z",
"snippets": [
{
"id": 1041257,
"guid": "f5b088cb2ec417f55398",
"title": "coinCombos.j
/*
Recursive Solution How do we go about defining a recursive function? Function definition — Our function should accept parameters. This way we can always test the value of these params to check whether or not we have reached the base case. Defining our base case — What is the trivial case, where we already know the solution for the problem. Make the problem smaller — Incrementing/decrementing our parameters which are passed into every recursive function call. If we don’t do this, our problem w
function fastFib(n, memo = {}) {
if (n in memo) return memo[n];
if (n === 1 || n === 2) return 1;
memo[n] = fastFib(n - 1, memo) + fastFib(n - 2, memo);
return memo[n];
}
fastFib(6); // => 8
fastFib(50); // => 12586269025
let memo = {}
function factorial(n) {
// if this function has calculated factorial(n) previously,
// fetch the stored result in memo
if (n in memo) return memo[n];
if (n === 1) return 1;
// otherwise, it havs not calculated factorial(n) previously,
// so calculate it now, but store the result in case it is
// needed again in the future
memo[n] = n * factorial(n - 1);
return memo[n]
}
factorial(6); // => 720, requires 6 calls
factorial(6); // => 720, requires 1 ca
function factorial(n) {
if (n === 1) return 1;
return n * factorial(n - 1);
}
factorial(6); // => 720, requires 6 calls
factorial(6); // => 720, requires 6 calls
factorial(5); // => 120, requires 5 calls
factorial(7); // => 5040, requires 7 calls
def bellman_ford(graph, source):
weight = {}
pre_node = {}
initialize_single_source(graph, source, weight, pre_node)
for i in range(1, len(graph)):
for node in graph:
for adjacent in graph[node]:
if weight[adjacent] > weight[node] + graph[node][adjacent]:
weight[adjacent] = weight[node] + graph[node][adjacent]
pre_node[adjacent] = node
for node in graph:
for adjacent in graph[node]:
# How To Deploy a Full-Stack MERN App with Heroku/Netlify
> This post is intended to be a guide for those that want to deploy a full-stack MERN app. It will be v...

[;
const today = new Date();
let dd = today.getDate();
let mm = today.getMonth() + 1;
const yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd;
}
if (mm < 10) {
mm = '0' + mm;
}
const datestamp = yyyy + '-' + mm + '-' + dd;
// get the meaningful arguments
process.argv.splice(0,2);
if(process.argv[0] == 'link') {
const template = require('./templates/link.js');
process.argv.splice(0,1);
let props = {
filename: process.argv.join("-").toLowerCase(),
## Overview
Stateful logic is logic that is built into a component. It can be a function that handles a click event or maybe a function that sets toggle state, or even a function that formats data before it gets displayed. Usually, this kind of logic deals with state in the component. Thus the moniker "stateful logic."
## Follow Along
Look at this component. Can you spot the stateful logic built into it?
```jsx
import React, { useState } from "react";
const DynamicTitle = () => {
const [t
# Contents
```txt
.
├── 0-TESTING-RESOURCES
│ ├── main-data
│ └── text-2-js
├── ALGO
│ ├── DOM-manipulation
│ ├── Dynamic-Programming
│ ├── LEETCODE
│ ├── UNSORTED
│ │ └── Hash Table Data-Structure
│ ├── __PYTHON
│ ├── anagrams
│ ├── array-manipulations
│ ├── binary_search_project
│ │ ├── lib
│ │ └── test
│ ├── callbacks-solution
│ │ ├── problems
│ │ └── test
│ ├── coin-change
│ │ ├── MINchange
│ │ │ └── test
│ │ ├── coinchange-memoized
│
# React.js cheatsheet
> React.Component · render() · componentDidMount() · props/state · dangerouslySetInnerHTML · React is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
[React](https://reactjs.org/) is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
# React Cheat Sheet
render
------
render() {
return <div />;
}
constructor
-----------
```js
constructor(props) {
super(props);
t
[ 30-seconds / 30-seconds-of-code](https://github.com/30-seconds/30-seconds-of-code)
====================================================================================
Unstar
Short JavaScript code snippets for all your development needs
[76634](https://github.com/30-seconds/30-seconds-of-code/stargazers)[8316](https://github.com/30-seconds/30-seconds-of-code/network/members)JavaScript
[ railsgirls / railsgirls.github.io](https://github.com/railsgirls/railsgirls.github.io)
=================
### [website-scraper / website-scraper-puppeteer](https://github.com/website-scraper/website-scraper-puppeteer)
Unstar
Plugin for website-scraper which returns html for dynamic websites using puppeteer
JavaScript [ 121 ](https://github.com/website-scraper/website-scraper-puppeteer/stargazers)[ 31 ](https://github.com/website-scraper/website-scraper-puppeteer/network/members)Updated 7 days ago
### [bgoonz / Lambda](https://github.com/bgoonz/Lambda)
Unstar
Learning tool for Lambda Students
[](https://github.com/colie31)
[Nichole colie31](https://github.com/colie31)
Was accepted and completed App Academy Software Engineering Program.
[](https://github.com/nicholasbierman)
[Nicholas Bierman nicholasbierman](https://github.com/nicholasbierman)
[@Lambda](https://github.com/Lambda) Grad | Full Stack Software Engineer | JavaSc
// --- Directions
// Given a linked list, return true if the list
// is circular, false if it is not.
// --- Examples
// const l = new List();
// const a = new Node('a');
// const b = new Node('b');
// const c = new Node('c');
// l.head = a;
// a.next = b;
// b.next = c;
// c.next = b;
// circular(l) // true
function circular(list) {
let slow = list.getFirst();
let fast = list.getFirst();
while (fast.next && fast.next.next) {
slow = slow.next;
fast = fast.next.n
https://drive.google.com/file/d/16MHxDvt2dXwKIaywcnpFS3p70Mls-8nH/view?usp=sharing
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "cma2IKnL9e-M"
},
"source": [
"# Exceptions \n",
"\n",
"* Programmer Errors \n",
"* Program Bugs \n",
"* Exceptions\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 132
},
"colab_type": "code",
"id": "1YGSrszE9cch",
"outputId": "30
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "6vddxASQcwOx"
},
"source": [
"# Functions\n",
"\n",
"Functions are blocks of code that can be used over and over again to perform a specific action.\n",
"\n",
"As we know, in Python, there are print (), len () etc. Many available functions are defined.\n",
"\n",
"We can use it in our own code by providing access to functions defined in libraries, modules and packa
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "HHgvBhnB5_uo"
},
"source": [
"\n",
"## Question-1\n",
"\n",
"Write a program that inputs an integer value (stop_number) from the user and prints the sum of all numbers from 0 to stop_number. You can assume the user will enter a valid value."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "N3
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Logical Operations"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
}
},
"source": [
"t, f = True, False\n",
"print(type(t))"
],
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": "<cla
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=yes"
/>
<title>working-w-jupyter-vscode</title>
<style type="text/css">
code {
white-space: pre-wrap;
}
span.smallcaps {
font-variant: small-caps;
}
span.underline {
tex
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# What is Python?\n",
"\n",
"* Python is an interpreted, high-level and general-purpose programming language.\n",
"* object-oriented approach aim to help programmers write clear\n",
"* dynamically typed and garbage-collected.\n",
"* Python was created in the late 1980s by Guido van Rossum"
]
},
{
"cell_type": "code",
"execution_cou
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-
# 100+ Python challenging programming exercises for Python 3
## 1. Level description
### Level 1 Beginner
Beginner means someone who has just gone through an introductory Python course. He can solve some problems with 1 or 2 Python classes or functions. Normally, the answers could directly be found in the textbooks.
### Level 2 Intermediate
Intermediate means someone who has just learned Python, but already has a relatively strong programming background from before. He should be able to solv
# Python Programming For Beginners
Welcome to this book on **"Learning Python In 100 Steps"**.
I am **Ranga Karanam**, and I have more than two decades of programming experience.
At **In28Minutes**, we ask ourselves one question every day: "how do we create awesome learning experiences?"
Whether we talk about big data, data analytics, or about doing simple things like scraping content from the web, Python is an awesome language for all that. Learning Python can be an awesome experience.
function first () {
second ();
function second () {
third ();
function third () {
fourth ();
function fourth () {
// do something
}
}
}
}
first ();
function foo() {
alert(this);
}
foo() // window
new foo() // foo
var obj = {
foo: function() {
return this;
}
};
obj.foo() === obj; // true
function createAdder() {
let counter = 0;
return function () {
counter++;
return counter;
}
}
let addOne = createAdder();
let result1 = addOne();
let result2 = addOne();
let result3 = addOne();
console.log(result1); // <Fill in Expected Result>
console.log(result2); // <Fill in Expected Result>
console.log(result3); // <Fill in Expected Result>
// This example is explained in detail below (just after this code box).
function celebrityIDCreator (theCelebrities) {
var i;
var uniqueID = 100;
for (i = 0; i < theCelebrities.length; i++) {
theCelebrities[i]["id"] = function () {
return uniqueID + i;
}
}
return theCelebrities;
}
var actionCelebs = [{name:"Stallone", id:0}, {name:"Cruise", id:0}, {name:"Willis", id:0}];
var createIdForActionCelebs = celebrityIDCreator (actionCelebs);
var
function celebrityID () {
var celebrityID = 999;
// We are returning an object with some inner functions
// All the inner functions have access to the outer function's variables
return {
getID: function () {
// This inner function will return the UPDATED celebrityID variable
// It will return the current value of celebrityID, even after the changeTheID function changes it
return celebrityID;
},
setID: function (theNew
function celebrityName (firstName) {
var nameIntro = "This celebrity is ";
// this inner function has access to the outer function's variables, including the parameter
function lastName (theLastName) {
return nameIntro + firstName + " " + theLastName;
}
return lastName;
}
var mjName = celebrityName ("Michael"); // At this juncture, the celebrityName outer function has returned.
// The closure (lastName) is called here after the outer function has returned above
function addOne() {
// this time, we define counter within our function
let counter = 0;
counter++;
}
// what do we expect to happen here?
console.log(counter); // <Fill in Expected Result>
// should this work? why/why not?
counter++;
console.log(counter); // <Fill in Expected Result>
addOne();
console.log(counter); // <Fill in Expected Result>
// I want addOne() to be the only way to access/alter the 'counter'
function addOne() {
let counter = 0;
counter++;
return counter;
}
let result1 = addOne();
let result2 = addOne();
let result3 = addOne();
console.log(result1); // <Fill in Expected Result>
console.log(result2); // <Fill in Expected Result>
console.log(result3); // <Fill in Expected Result>
let counter = 0;
function addOne() {
counter++;
}
// I want addOne() to be the only way to access/alter the 'counter', but that's not the case.
addOne();
addOne();
addOne();
counter = -Infinity;
console.log(counter); // <Fill in Expected Result>
function showName (firstName, lastName) {
var nameIntro = "Your name is ";
// this inner function has access to the outer function's variables, including the parameter
function makeFullName () {
return nameIntro + firstName + " " + lastName;
}
return makeFullName ();
}
showName ("Michael", "Jackson"); // Your name is Michael Jackson
{ // Global
lastName String: 'Bob',
greet Function: { // Local to greet
firstName String: 'Jim'
},
// alert Function: Lives on the global scope, but gets called from with inside greet.
}
let average = function (num1, num2) {
let avg = (num1 + num2) / 2;
return avg;
};
let averageArrow = (num1, num2) => {
let avg = (num1 + num2) / 2;
return avg;
};
let aboundFunc = func.bind (context, arg1, arg2 /*etc...*/);
const sum = function (a, b) {
return a + b;
};
const add3 = sum.bind (null, 3);
console.log (add3 (10)); // 13
const multiply = function (a, b) {
return a * b;
};
//--------------------------------------------------
const double = multiply.bind (null, 2);
const triple = multiply.bind (null, 3);
console.log (double (3)); // 6 console.log(triple(3)); // 9
let cat = {
purr: function () {
console.log("meow");
},
purrMore: function () {
this.purr();
},
};
let sayMeow = cat.purrMore;
console.log(sayMeow()); // TypeError
let boundCat = sayMeow.bind(cat);
boundCat(); // prints "meow"
let dog = {
name: "Bowser",
changeName: function () {
this.name = "Layla";
},
};
let change = dog.changeName;
console.log(change()); // undefined
console.log(dog); // { name: 'Bowser', changeName: [Function: changeName] }
console.log(this); // Object [global] {etc, etc, etc, name: 'Layla'}
function isPalindrome(string) {
function reverse() {//reverse 'closes' over the variables & parameters (in this case 'string') available within the scope of the outter function
return string.split("").reverse().join("");
}
return string === reverse();
}
function magicConchShouldIUseVar() {
let reasons = Infinity;
for (let i = 0; i < reasons; i++) {
if (i < reasons) {
return "NO";
} else {
return "still no brah";
}
}
}
console.log(magicConchShouldIUseVar());
/*
|04:22:31|bryan@LAPTOP-9LGJ3JGS:[WebPack] WebPack_exitstatus:0[╗__________________________________________________________o>
node magicConch.js
NO
|04:22:47|bryan@LAPTOP-9LGJ3JGS:[WebPack] WebPack_exitstatus:0[╗_______________________________________________
function someFunction(){
if (true){
// This variable is defined inside these
// curly braces, which means its part of the
// scope of this block and cannot be accessed
// by other parts of someFunction.
let blockVariable = 30;
// However, using the 'var' keyword this variable,
// while defined inside the same block, is part of
// the scope of the someFunction.
var functionVariable = 30;
// Inside the block, both variables are accessible.
console
//A var declared anywhere in a function will be automatically included at the top level of that function and assigned ‘undefined’. For instance:
function hello( assign ) {
console.log(message); //prints undefined
if (assign) {
var message = "Hello there!";
console.log(message); // prints "Hello there!"
}
}
//Notice that you can print out the contents of message even though it may have never been initialized. This is because Javascript actually rewrites that code into:
function he
- [to read](https://gist.github.com/bgoonz/b07979f7a4a1c87f68e66e888dd2bbb2)
let counter = 0;
function addOne() {
counter++;
}
console.log(counter); // <Fill in Expected Result>
counter++;
console.log(counter); // <Fill in Expected Result>
addOne();
console.log(counter); // <Fill in Expected Result>
// creates a new variable 'counter' and set it's initial value to 0;
let counter = 0;
// creates a new function 'addOne' which takes 0 parameters
function addOne() {
// adds one to counter. Equivalent to counter = counter + 1;
counter++;
}
// calling a function. This executes the body of the named function.
addOne();
// prints our result to the console
console.log(counter);
---
## A - C
- [Ableton](https://www.ableton.com/en/about) | Berlin, Germany | Take-home programming task (discussed via Skype), then pair programming and debugging session on-site
- [Abstract](https://angel.co/abstract/jobs) | San Francisco, CA
- [Accenture](https://www.accenture.com/us-en/careers) | San Francisco, CA / Los Angeles, CA / New York, NY | Technical phone discussion with architecture manager, followed by behavioral interview focusing on soft skills
- [Accredible](https://www.accr
import urllib3
from bs4 import BeautifulSoup
import requests
import os
import csv
import unicodedata
import pandas as pd
def get_links(tag, suffix):
url = 'https://medium.com/tag/' + tag
urls = [url + '/' + s for s in suffix]
links = []
for url in urls:
data = requests.get(url)
soup = BeautifulSoup(data.content, 'html.parser')
articles = soup.findAll('div', {"class": "postArticle-readMore"})
for i in articles:
links.append(i.a.get('hre
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "medium-backup-script.ipynb",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.goog
# Creating gists - GitHub Docs
> You can create two kinds of gists: public and secret. Create a public gist if you're ready to share your ideas with the world or a secret gist if you're not.
You can create two kinds of gists: public and secret. Create a public gist if you're ready to share your ideas with the world or a secret gist if you're not.
### [About gists](#about-gists)
Every gist is a Git repository, which means that it can be forked and cloned. If you are signed in to GitHub when y
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Overview of Colaboratory Features",
"provenance": [],
"collapsed_sections": [],
"toc_visible": true,
"include_colab_link": true
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
#!/bin/bash
TARGET_DIR=("$@")
[ "x$1" == "x" ] && TARGET_DIR=(".")
function confirmDeletion() {
local confirm=""
until [ "x$confirm" == 'xy' ] || [ "x$confirm" == 'xn' ]
do
read -ep " Delete [y/n]: " confirm
confirm=$(echo "$confirm" | tr [:upper:] [:lower:])
done
[ "x$confirm" == 'xy' ]
}
function deleteWithConfirmation() {
for file in "${@}"
do
if rm "$file"; then
echo " OK: $file"
else
# Authenticate
$clientID = 'myGitHubUsername'
# GitHub API Client Secret
$clientSecret = '21c22a9f0ca888373a3077614d0abcdefghijklmnop'
# Basic Auth
$Bytes = [System.Text.Encoding]::utf8.GetBytes("$($clientID):$($clientSecret)")
$encodedAuth = [Convert]::ToBase64String($Bytes)
# Search based on Description
$search = "Import Script"
$Headers = @{Authorization = "Basic $($encodedAuth)"; Accept = 'application/vnd.github.v3+json'}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocol
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE
{
"{\"filename\":\"/mnt/c/Lambda/CIRRICULUMN/lambda-backup-2/lambda-static-b/Lambda-Resource-Static-Assets/js-stack-walkthrough-master/02-babel-es6-eslint-flow-jest-husky/src/index.js\",\"env\":{},\"retainLines\":false,\"highlightCode\":true,\"suppressDeprecationMessages\":false,\"presets\":[],\"plugins\":[[[],null],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],{\"loose\":false}],[[],{\"loose\":fals
sudo apt-get update --fix-missing
sudo apt-get install -f
sudo apt-get update
sudo apt-get clean
sudo apt-get autoremove
sudo dpkg --remove -force --force-remove-reinstreq Package_Name
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\WINDOWS\system32> Get-WmiObject -Class Win32_Product
IdentifyingNumber : {85D19DA1-199F-4C56-B156-E8AFC3592036}
Name : ScreenToGif
Vendor : Nicke Manarin
Version : 2.30.0
Caption : ScreenToGif
IdentifyingNumber : {665D6AE4-7439-49A1-840E-671E88B67B13}
Name : HOTKEY
Vendor : Lenovo
V
// Immutable vs Mutable
// Strings are IMMUTABLE
let str = "abc";
str[ 1 ] = "x";
// console.log(str); // => 'abc'
// We can reassign a variable to another string
beforeStr = str;
str += "def"; // str = str + 'def'
// console.log(str) // 'abcdef'
// console.log(str === beforeStr); // false
const anotherStr = "abcdef";
// console.log(str === anotherStr); // true
// Arrays are MUTABLE
let arr = [ "a", "b", "c" ];
let beforeArr = arr;
arr[ 1 ] = "x";
console.log( arr ); // ['a', 'x', 'c']
let me = {
name: "Ian",
instruments: ['bass', 'synth', 'guitar'],
siblings: {
brothers: ['Alistair'],
sisters: ['Meghan']
}
}
let {
name,
instruments: musical_instruments,
siblings: {
sisters
}
} = me;
console.log(sisters);
function printInstruments({
instruments
}) {
console.log(instruments);
}
printInstruments(me);
function printSiblings({
siblings: {
sisters,
brothers
}
}) {
console.log("Sisters",
const fs = require("fs");
const path = require("path");
const npm = require("./npm.js");
const color = require("ansicolors");
const output = require("./utils/output.js");
const usageUtil = require("./utils/usage.js");
const { promisify } = require("util");
const glob = promisify(require("glob"));
const readFile = promisify(fs.readFile);
const didYouMean = require("./utils/did-you-mean.js");
const { cmdList } = require("./utils/cmd-list.js");
const usage = usageUtil("help-search", "npm help-sear
import _ from 'lodash';
import getPage from './getPage';
export default function toUrl(pages, pagePath) {
if (_.startsWith(pagePath, '#')) {
return pagePath;
} else {
// remove extension
pagePath = pagePath.replace(/\.\w+$/, '');
const page = getPage(pages, pagePath);
if (!page) {
throw new Error('could not find page with path: ' + pagePath);
}
return page.url;
}
}
# Simple function that will take a string of latin characters and return a unique hash
def hashString(str):
# Map characters to prime numbers to multiply
charMap = {
'a': 2,
'b': 3,
'c': 5,
'd': 7,
'e': 11,
'f': 13,
'g': 17,
'h': 19,
'i': 23,
'j': 29,
'k': 31,
'l': 37,
'm': 41,
'n': 43,
'o': 47,
'p': 53,
'q': 59,
'r': 61,
's': 67,
't': 71,
'u': 73,
'v': 79,
'w': 83,
'x': 89,
'y': 97,
'z':
import waitUntil from './waitUntil';
class Queue {
pendingEntries = [];
inFlight = 0;
err = null;
constructor(worker, options = {}) {
this.worker = worker;
this.concurrency = options.concurrency || 1;
}
push = (entries) => {
this.pendingEntries = this.pendingEntries.concat(entries);
this.process();
};
process = () => {
const scheduled = this.pendingEntries.splice(0, this.concurrency - this.inFlight);
this.inFlight += scheduled.length;
scheduled.f
const fs = require('fs');
const path = require('path');
const markdownRegex = /\.md$/;
/**
* Returns the markdowns of the documentation in a flat array.
* @param {string} [directory]
* @param {Array<{ filename: string, pathname: string }>} [pagesMarkdown]
* @returns {Array<{ filename: string, pathname: string }>}
*/
function findPagesMarkdown(
directory = path.resolve(__dirname, '../../../src/pages'),
pagesMarkdown = [],
) {
const items = fs.readdirSync(directory);
items.forEach(
How to setup a development environment where Git from WSL integrates with native Windows applications, using the Windows home folder as the WSL home and using Git from WSL for all tools.
**Note** if using Git for Windows, or any tool on the Windows side that does not use Git from WSL then there will likely be problems with file permissions inside WSL.
## Tools
These are the tools I use:
* git (wsl) - Command line git from within WSL.
* [Fork](https://www.fork.dev) (windows) - Git GUI (must be
GithubCloner
=============
# A script that clones Github repositories of users and organizations. #
# Usage #
| Description | Command |
|-----------------------------------------------------------|-----------------------------------------------------------------------------|
| Help | `./githubcloner.py --help`
This works for me
**Install prettier:**
```
npm init -y
npm i prettier
```
Add following **script** in **package.json:**
```
"pretty": "prettier --write \"./**/*.{js,jsx,json}\""
```
In this case only, i need to format my .js .jsx and .json files.
Run script:
```
npm run pretty
```
'''
Climbing Staircase
There exists a staircase with N steps, and you can climb up either X different steps at a time.
Given N, write a function that returns the number of unique ways you can climb the staircase.
The order of the steps matters.
Input: steps = [1, 2], height = 4
Output: 5
Output explanation:
1, 1, 1, 1
2, 1, 1
1, 2, 1
1, 1, 2
2, 2
=========================================
Dynamic Programing solution.
Time Complexity: O(N*S)
Space Complexity: O(N)
'''
###########
//== BASICS ==//
/**
* (1) x is a string, b/c we’ve initialized it
*/
let x = "hello world";
/**
* (2) reassignment is fine
*/
x = "hello mars";
/**
* (3) but if we try to change type
*/
// x = 42; // 🚨 ERROR
/**
* (4) let's look at const. The type is literally 'hello world'
*/
const y = "hello world";
/**
* This is called a 'string literal type'. y can never be reassigned since it's a const,
* so we can regard it as only ever holding a value that's literally the string 'hello wor
# Mixed sorting
"""
Given a list of integers nums, sort the array such that:
All even numbers are sorted in increasing order
All odd numbers are sorted in decreasing order
The relative positions of the even and odd numbers remain the same
Example 1
Input
nums = [8, 13, 11, 90, -5, 4]
Output
[4, 13, 11, 8, -5, 90]
Explanation
The even numbers are sorted in increasing order, the odd numbers are sorted in
decreasing number, and the relative positions were
[even, odd, odd, even, odd, even] an
This works for me
Install prettier:
npm init
npm i prettier
Add following script in package.json:
"pretty": "prettier --write \"./**/*.{js,jsx,json}\""
In this case only, i need to format my .js .jsx and .json files.
Run script:
npm run pretty
# cool-node-modules
> A list of cool node modules. Inspired by [awesome](https://github.com/sindresorhus/awesome).
## Applications
- [clocker](https://github.com/substack/clocker): Track project hours.
- [deejay](https://github.com/mafintosh/deejay): Music player that broadcasts to everyone on the same network.
- [http-server](https://github.com/indexzero/http-server): A simple zero-configuration command-line http server.
- [jsinspect](https://github.com/danielstjules/jsinspect): Detect copy-p
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
font-size: 1.2em;
}
</style>
<STYLE type="text/css" media="print">
body{margin:0;}
</STYLE>
</head>
<body>
<div id="out">
No Trello JSON data found
</div>
</ul>
</div>
<script type="text/html" id="template-output" >
const importModules = require('import-modules');
const fs = require('fs');
const modules = importModules('./');
console.log(modules);
//=> {fooBar: [Function], bazFaz: [Function]}
const content = `${JSON.stringify(modules)}`;
try {
const data = fs.writeFileSync('./test.json', content)
fs.writeFile('test1.js', content, {
flag: 'a+'
}, err => {})
//file written successfully
} catch (err) {
console.error(err)
}
# Assume the current directory is where we want the new repository to be created
# Create the new repository
git init
# Before we do a merge, we have to have an initial commit, so we’ll make a dummy commit
dir > deleteme.txt
git add .
git commit -m “Initial dummy commit”
# Add a remote for and fetch the old repo
git remote add -f old_a <OldA repo URL>
# Merge the files from old_a/master into new/master
git merge old_a/master
# Clean up our dummy file because we don’t need it any more
git rm
# Given an integer n, return any array containing n unique integers such that they add up to 0.
# Example 1: Input: n = 5 | Output: [-7,-1,1,3,4]
# Explanation: These arrays also are accepted [-5,-1,1,2,3] , [-3,-1,2,-2,4].
# Example 2: Input: n = 3 | Output: [-1,0,1]
# Example 3: Input: n = 1 | Output: [0]
# Constraints: 1 <= n <= 1000
## time complexity: O(1 or n)
## space complexity: O(1)
def sumZero(self, n: int):
"""
:type n: int
:rtype: List[int]
const isEmail = (email) => {
const regEx = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (email.match(regEx)) return true;
else return false;
};
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.8
* Copyright (C) 2019 Oliver Nightingale
* @license MIT
*/
;(function(){
/**
* A convenience function for configuring and constructing
* a new lunr Index.
*
* A lunr.Builder instance is created and the pipeline setup
* with a trimmer, stop word filter and stemmer.
*
* This builder object is yielded to the configuration function
* that is passed as a parameter, allowing the list of fields
*
#!/usr/bin/env python
""" Print all of the clone-urls for a GitHub organization.
It requires the pygithub3 module, which you can install like this::
$ sudo yum -y install python-virtualenv
$ mkdir scratch
$ cd scratch
$ virtualenv my-virtualenv
$ source my-virtualenv/bin/activate
$ pip install pygithub3
Usage example::
$ python list-all-repos.py
Advanced usage. This will actually clone all the repos for a
GitHub organization or user::
$ for url in $(python list-a
const themes = {
default: {
title_color: "2f80ed",
icon_color: "4c71f2",
text_color: "333",
bg_color: "fffefe",
border_color: "e4e2e2",
},
default_repocard: {
title_color: "2f80ed",
icon_color: "586069", // icon color is different
text_color: "333",
bg_color: "fffefe",
},
dark: {
title_color: "fff",
icon_color: "79ff97",
text_color: "9f9f9f",
bg_color: "151515",
},
radical: {
title_color: "fe428e",
icon_color: "f8d847",
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule <name>"
- Delete the now untracked submodule files rm -rf pat
//APPEND-DIR.js
const fs = require( 'fs' ); let cat = require( 'child_process' ).execSync( 'cat *' ).toString( 'UTF-8' );
fs.writeFile( 'output.md', cat, ( err ) => { if ( err ) throw err; } );
# React.js cheatsheet
> React.Component · render() · componentDidMount() · props/state · dangerouslySetInnerHTML · React is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
[React](https://reactjs.org/) is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
# React Cheat Sheet
render
------
render() {
return <div />;
}
constructor
-----------
```js
constructor(props) {
super(props);
t
### ...or create a new repository on the command line
```
echo "# React-Self-Study" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M master
git remote add origin https://github.com/bgoonz/React-Self-Study.git
git push -u origin master
```
### ...or push an existing repository from the command line
```
git remote add origin https://github.com/bgoonz/React-Self-Study.git
git branch -M master
git push -u origin master
```
### ...or import code from another reposit
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta http-equiv="Content-Type" content="text/html">
<meta name="Author" content="Bryan Guner">
<meta name="keywords" content="HTML, Meta Tags, Metadata">
<meta name="description" content="Learning about Web Development.">
<meta name="revised" content="Bryan Guner 4/16/2021">
<
Unlike the lifecycle methods above (which React calls for you), the methods below are the methods _you_ can call from your components.
There are just two of them: `setState()` and `forceUpdate()`.
### [](https://reactjs.org/docs/react-component.html#setstate)`setState()`
```js
setState(updater, [callback])
```
`setState()` enqueues changes to the component state and tells React that this component and its children need to be re-rendered with the updated state. This is the primary method you
let NewComponent = React.createClass ({
render: function () {
return (
<div>
{/* Hello world */}
<div className="awesome" style={{border: '1px solid red'}}>
<label htmlFor="name">Enter your name: </label>
<input type="text" id="name" />
</div>
<p>Enter your HTML here</p>
</div>
);
},
});
import React, { Component } from 'react';
class ChildComponent extends Component {
constructor() {
super();
this.state = {
clicked: false
};
}
handleClick = () => {
this.setState({ clicked: !this.state.clicked });
};
render() {
const styles = this.state.clicked ? { textDecoration: 'line-through'} : { textDecoration: 'none' };
return (
<div style={styles} onClick={this.handleClick}>{this.props.thing}</div>
);
}
}
export default ChildComponen
import React, { Component } from 'react';
import ChildComponent from './ChildComponent';
class ParentComponent extends Component {
constructor() {
super();
this.state = {
ingredients: ['flour', 'eggs', 'milk', 'sugar', 'vanilla'],
newIngredient: ''
};
}
handleIngredientInput = (event) => {
this.setState({ newIngredient: event.target.value });
};
addIngredient = (event) => {
event.preventDefault();
con
import React, { Component } from 'react';
class ClassComponentIteratingState extends Component {
constructor() {
super();
this.state = {
ingredients: ['flour', 'eggs', 'milk', 'sugar', 'vanilla extract'],
newIngredient: ''
};
}
handleIngredientInput = (event) => {
this.setState({ newIngredient: event.target.value });
};
addIngredient = (event) => {
event.preventDefault();
const ingredientsList = this.
import React, { Component } from 'react';
class ClassComponentUpdatingState extends Component {
constructor() {
super();
this.state = {
aNumber: 8
};
}
increment = () => {
this.setState({ aNumber: ++this.state.aNumber });
};
decrement = () => {
this.setState({ aNumber: --this.state.aNumber });
};
render() {
return (
<div>
<div>{`Our number: ${this.state.aNumber}`}</div>
<button onClick={this.increment}>+</button>
<butt
class ClassComponentWithState extends Component {
state = {
someData: 8
};
render() {
return (
<div>{`Here's some data to render: ${this.state.someData}`}</div>
);
}
}
export default ClassComponentWithState;
class ClassComponentWithState extends Component {
constructor() {
super();
this.state = {
someData: 8
};
}
render() {
return (
<div>{`Here's some data to render: ${this.state.someData}`}</div>
);
}
}
export default ClassComponentWithState;
import React, { Component } from 'react';
class ClassComponentWithState extends Component {
constructor() {
super();
this.state = {};
}
render() {
return (
<div>Hello World!</div>
);
}
}
export default ClassComponentWithState;
import React, { Component } from 'react';
class BasicClassComponent extends Component {
render() {
return (
<div>Hello World!</div>
);
}
}
export default BasicClassComponent;
import React from 'react';
const BasicComponent = () => <div>Hello World!</div>;
export default BasicComponent;
function PercentageStat({ label, score = 0, total = Math.max(1, score) }) {
return (
<div>
<h6>{ label }</h6>
<span>{ Math.round(score / total * 100) }%</span>
</div>
)
}
// CONVERTED TO PURE COMPONENT
class PercentageStat extends React.PureComponent {
render() {
const { label, score = 0, total = Math.max(1, score) } = this.props;
return (
<div>
<h6>{ label }</h6>
<span>{ Math.round(score / total * 100) }%</span>
</div>
)
}
This appendix is a non-exhaustive list of new syntactic features and methods that were added to JavaScript in ES6. These features are the most commonly used and most helpful.
While this appendix doesn't cover ES6 classes, we go over the basics while learning about components in the book. In addition, this appendix doesn't include descriptions of some larger new features like promises and generators. If you'd like more info on those or on any topic below, we encourage you to reference the [Mozil
class Timer extends React.Component {
constructor(props) {
super(props);
this.state = { seconds: 0 };
}
tick() {
this.setState(state => ({
seconds: state.seconds + 1
}));
}
componentDidMount() {
this.interval = setInterval(() => this.tick(), 1000);
}
componentWillUnmount() {
clearInterval(this.interval);
}
render() {
return (
<div>
Seconds: {this.state.seconds}
</div>
);
}
}
ReactDOM.render(
<Timer />,
documen
const HelloMessage = props => <div>
Hello {props.name}
</div>;
ReactDOM.render(<HelloMessage name="Taylor" />, document.getElementById('hello-example'));
const Timer = () => <div>
Seconds: {this.state.seconds}
</div>;
ReactDOM.render (<Timer />, document.getElementById ('timer-example'));
function Todo () {
const [tasks, setTasks] = useState ([
{
title: 'Grab some Pizza',
completed: true,
},
{
title: 'Do your workout',
completed: true,
},
{
title: 'Hangout with friends',
completed: false,
},
]);
const addTask = title => {
const newTasks = [...tasks, {title, completed: false}];
setTasks (newTasks);
};
const completeTask = index => {
const newTasks = [...tasks];
newTasks[index].completed = true;
class MarkdownEditor extends React.Component {
constructor(props) {
super(props);
this.md \= new Remarkable();
this.handleChange \= this.handleChange.bind(this);
this.state \= { value: 'Hello, \*\*world\*\*!' };
}
handleChange(e) {
this.setState({ value: e.target.value });
}
getRawMarkup() {
return { \_\_html: this.md.render(this.state.value) };
}
render() {
return (
<div className\="MarkdownEditor"\>
<h3\>Input</h3\>
<label htmlFor
class Kitten extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<h1>Hi</h1>
);
}
}
###### 1. What's the output?
```javascript
function sayHi() {
console.log(name);
console.log(age);
var name = 'Lydia';
let age = 21;
}
sayHi();
```
- A: `Lydia` and `undefined`
- B: `Lydia` and `ReferenceError`
- C: `ReferenceError` and `21`
- D: `undefined` and `ReferenceError`
<details><summary><b>Answer</b></summary>
<p>
#### Answer: D
Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is se
const theDate = new Date();
const footer = document.querySelector(".site-footer");
footer.style.fontWeight = "600";
footer.style.letterSpacing = "0.07rem";
footer.style.fontFamily = "Share Tech Mono, monospace";
footer.innerHTML =` © ${theDate.getFullYear()} Bryan Guner;`;
@Windows Users: go to C:\Users\''yourUserName"\AppData\Roaming\Code and delete
Cache\
CachedDate\
CachedExtensions\
Code Cache
// var blob = new Blob();
//Blobs are immutable objects that represent raw data. File is a derivation of Blob that represents data from the file system. Use FileReader to read data from a Blob or File. Blobs allow you to construct file like objects on the client that you can pass to apis that expect urls instead of requiring the server provides the file.
// console.log(blob.size);
// console.log(blob.type);
var blob = new Blob(["foo", "bar"]);
console.log("size=" + blob.size);
console.log("type
[Source](http://www.fprintf.net/vimCheatSheet.html "Permalink to Vim Commands Cheat Sheet")
# Vim Commands Cheat Sheet
* * *
## How to Exit
:q[uit]
Quit Vim. This fails when changes have been made.
:q[uit]!
Quit without writing.
:cq[uit]
Quit always, without writing.
:wq
Write the current file and exit.
:wq!
Write the current file and exit always.
:wq {file}
Write to {file}. Exit if not editing the last
:wq! {file}
Write to {file} and exit always.
:[range]wq[!]
[file] Same as above,
wget -q -O - https://api.github.com/users/bgoonz/gists | grep raw_url | awk -F\" '{print $4}' | xargs -n1 wget
</head>
<body>
<div id="container" class='container'>
<div class="row"></div>
</div>
</body>
<script>'use strict';
document.getElementsByClassName('container')[0].getElementsByClassName('row')[0].insertAdjacentHTML('afterend', `<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"><\/script>
<div id="timeline" style="height: 180px;"></div>\n\n <script> google.charts.load(\'current\', {\'packages\':[\'timeline\']});
function PeopleList(props) {
return (
<ul>
{props.people.map(person => (
<li>{person.lastName}, {person.firstName}</li>
))}
</ul>
);
}
const peopleListElement = document.querySelector('#people-list');
fetch('https://example.com/api/people')
.then(response => response.json())
.then(people => {
const props = { people };
ReactDOM.render(<PeopleList props={props}/>, peopleListElement);
});
fetch('https://example.com/api/people')
.then(response => response.json())
.then(people => {
const html = '<ul>';
for (let person of people) {
html += `<li>${person.lastName}, ${person.firstName}</li>`;
}
html += '</ul>';
document.querySelector('#people-list').innerHTML = html;
});
## Table of Contents
###### The None value
###### Boolean values
###### Truthiness
###### Number values
###### Integer
###### Float
###### Type casting
###### Arithmetic Operators
###### String values
###### Length
###### Indexing
###### String Functions
###### index
###### count
###### Concatenation
###### Formatting
###### Useful string methods
###### Variables
###### Duck typing
###### Assignment
###### Comparison operators
###### Assignment operators
###### Flow-cont
Github Remote Hung Up Unexpectedly
// Increase your buffer size
git config --global http.postBuffer 157286400
#!/bin/sh
#find ./ | grep -i "\.*$" >files
find. / |sed - E - e 's/([^ ]+[ ]+){8}//' | grep - i "\.*$" > files
listing = "files"
out = ""
html = "index.html"
out = "basename $out.html"
html = "index.html"
cmd ()
{
echo ' <!DOCTYPE html>'
echo '<html>'
echo '<head>'
echo ' <meta http-equiv="Content-Type" content="text/html">'
echo ' <meta name="Author" content="Bryan Guner">'
echo
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs
# Why do we test?
**1. To make sure everything works**
2. **To increase flexibility and reduce fear**
- **oftentimes we have to go back and refactor code**
- **w/o tests you'd be walking on eggshells, frightened of breaking stuff**
- **w/ tests you can refactor w/ confidence**
- **if anything breaks, you'll know**
3. Make collaboration easier
- you have expectations for the module youre working on
- specs are effective form of communication
- as long as you meet the
* Data structures: How data is stored in memory and what that looks like in
terms of their representation.
* Algorithms: The algorithms used to access and modify that data.
* Big-O: How the efficiency of those algorithms are measured.
********************************************************************************
## Concrete Structures
Concrete data types are concretely implemented representations of data. Usually,
there are many ways to implement the same 'Abstract Data Type' using several
javascript
Set // Built-in added with JS2015
javascript
class TupleMap {
constructor() { // Stores data as an array of "tuples":
this.data = []; // [[key1, value1], [key2, value2], [key3, value3]]
}
set (key, value) {
const i = this.data.findIndex(x => {
return x[0] === key;
});
if (i >= 0) {
this.data[i][1] = value;
} else {
this.data.push([key, value]);
}
}
get(key) {
const datum = this.data.find(x => {
return x[0] === key;
});
if (datum === undefined) return;
retu
javascript
Map // Built-in added in JS2015
javascript
class ArrayMap {
constructor() { // Stores data in two different arrays:
this.keys = []; // [key1, key2, key3]
this.values = []; // [value1, value2, value3]
}
set(key, value) {
const i = this.keys.indexOf(key);
if (i >= 0) {
this.values[i] = value;
return this.values[i];
} else {
this.keys.push(key);
this.values.push(value);
}
}
get(key) {
const i = this.keys.indexOf(key);
if (i >= 0) {
return this.values[i];
javascript
class ArraySet {
constructor() { // 1. Creates an array to hold the elements.
this.data = [];
}
add(o) { // 2. Only adds elements that do not exist.
if (!this.data.includes(o)) {
this.data.push(o);
}
}
}
remove(o) { // 3. Removes an element if it exists.
const i = this.data.indexOf(o);
if (i >= o) {
this.data.splice(i, 1);
}
}
has(o) { // 4. Can tell you if something exists in the set.
return this.data.includes(o);
}
}
javascript
[1, 2, 3] // array
{a: 1, b: 2, c: 3} // object literal
"This is text" // string
class YourClass { // class
constructor(name) {
this.name = name;
}
}
# [WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively
This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)
## Requirements
* **Install [GPG4Win](https://gpg4win.org/download.html)**: _this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is
Use an invisible <iframe>:
<iframe id="my_iframe" style="display:none;"></iframe>
<script>
function Download(url) {
document.getElementById('my_iframe').src = url;
};
</script>
To force the browser to download a file it would otherwise be capable of rendering (such as HTML or text files), you need the server to set the file's MIME Type to a nonsensical value, such as application/x-please-download-me or alternatively application/octet-stream, which is used for arbitrary binary data.
import {DEFAULT_FORMAT} from "../const"
import {Datetime} from "../type";
const fnFormat = Datetime.prototype.format;
Datetime.use({
buddhist() {
return this.year() + 543;
},
format(format, locale) {
format = format || DEFAULT_FORMAT;
const matches = {
BB: (this.buddhist() + "").slice(-2),
BBBB: this.buddhist()
}
let result = format.replace(/(\[[^\]]+])|B{4}|B{2}/g, (match, $1) => $1 || matches[match])
return
/* global jQuery, Metro */
(function(Metro, $) {
'use strict';
Metro.utils = {
isVisible: function(element){
var el = $(element)[0];
return this.getStyleOne(el, "display") !== "none"
&& this.getStyleOne(el, "visibility") !== "hidden"
&& el.offsetParent !== null;
},
isUrl: function (val) {
/* eslint-disable-next-line */
return /^(\.\/|\.\.\/|ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[
/*! docsearch 2.6.2 | © Algolia | github.com/algolia/docsearch */
( function webpackUniversalModuleDefinition( root, factory ) {
if ( typeof exports === "object" && typeof module === "object" ) module.exports = factory();
else if ( typeof define === "function" && define.amd ) define( [], factory );
else if ( typeof exports === "object" ) exports[ "docsearch" ] = factory();
else root[ "docsearch" ] = factory()
} )( typeof self !== "undefined" ? self : this, function () {
return function
Converting md files to html w/highlighting
0a) Create a root directory to pull in all the repos
0b) Recursively clone or pull each repo
$> git clone <repo_url> | git pull on the existing repos
0c) Create a TOC index.html file for the root folder
$> echo '<head>' >> index.html
$> echo '' >> index.html
$> echo '</head>' >> index.html
$> echo '<body>' >> index.html
$> ls >> temp.html
$> sed -n '/./s/<a href="($1)">($1)</a>/p' temp.html >> index.html
$> echo '</body>' >> index.html
$> rm
"use strict";
{
const MAX_PROBES = 256; // if chains or open addressing rehashes are longer than this, something is wrong
class HashTable {
constructor ( {
hashFunction: hashFunction = HashTable.basicHash,
pairsList: pairsList = null,
numSlots: numSlots = 256,
maxRatio: maxRatio = 0.75, // load factor ( keys/slots ) at which to grow and rehash
desiredCollisionProbability: desiredCollisionProbability = NaN,
/* ---------
* Challenge
* ---------
Create an addition function that does not utilize the + or - operators.
Note: You may not use the + and - operators within a subroutine, or use eval or new Function.
*/
function add (x, y) {
while(y) {
x^=y, y=(y&x^y)<<1;
}
return x;
}
/* ---------
* Challenge
* ---------
Create an addition function that does not utilize the + or - operators.
Note: You may not use the + and - operators within a subroutine, or use eval or new Function.
*/
function add (x, y) {
while(y) {
x^=y, y=(y&x^y)<<1;
}
return x;
}
Front-end Frameworks v2.6
====================
A collection of best front-end frameworks for faster and easier web development.
You can **Compare** all front-end frameworks here: http://usablica.github.com/front-end-frameworks/compare.html
## IceCream
> Simple and light responsive grid system
**Responsive:** Yes
**Website:** http://html5-ninja.com/icecream
## Formee Framework for forms
> Formee is nothing but a framework to help you develop and customize web based forms.
> Crossbrowser:
## Table of Contents
- [Awesome PHP](#awesome-php)
- [Composer Repositories](#composer-repositories)
- [Dependency Management](#dependency-management)
- [Dependency Management Extras](#dependency-management-extras)
- [Frameworks](#frameworks)
- [Framework Extras](#framework-extras)
- [Content Management Systems](#content-management-systems-cms)
- [Components](#components)
- [Micro Frameworks](#micro-frameworks)
- [Micro Framework Extras](#micro-framework-extra
# Awesome Python
A curated list of awesome Python frameworks, libraries and software. Inspired by [awesome-php](https://github.com/ziadoz/awesome-php).
- [Awesome Python](#awesome-python)
- [Environment Management](#environment-management)
- [Package Management](#package-management)
- [Package Repositories](#package-repositories)
- [Distribution](#distribution)
- [Build Tools](#build-tools)
- [Interactive Interpreter](#interactive-interpreter)
- [Files](#files)
<a data-v-ba6985fe="" href="https://github.com/bgoonz" aria-label="View source on Github"
class="github-corner"><svg data-v-ba6985fe="" width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"
style="fill: rgb(253, 108, 108); color: rgb(255, 255, 255); position: absolute; top: 0px; border: 0px; right: 0px;">
<path data-v-ba6985fe="" d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path data-v-ba6985fe=""
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6
#!/bin/bash
#
# Copyright Bart Trojanowski <bart@jukie.net>
#
# git-wip is a script that will manage Work In Progress (or WIP) branches.
# WIP branches are mostly throw away but identify points of development
# between commits. The intent is to tie this script into your editor so
# that each time you save your file, the git-wip script captures that
# state in git. git-wip also helps you return back to a previous state of
# development.
#
# See also http://github.com/bartman/git-wip
#
# The co
```js no-beautify
"" + 1 + 0 = "10" // (1)
"" - 1 + 0 = -1 // (2)
true + false = 1
6 / "3" = 2
"2" * "3" = 6
4 + 5 + "px" = "9px"
"$" + 4 + 5 = "$45"
"4" - 2 = 2
"4px" - 2 = NaN
" -9 " + 5 = " -9 5" // (3)
" -9 " - 5 = -14 // (4)
null + 1 = 1 // (5)
undefined + 1 = NaN // (6)
" \t \n" - 2 = -2 // (7)
```
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
2. The subtraction `-` (like most math operations)
# Interaction: alert, prompt, confirm
As we'll be using the browser as our demo environment, let's see a couple of functions to interact with the user: `alert`, `prompt` and `confirm`.
## alert
This one we've seen already. It shows a message and waits for the user to press "OK".
For example:
```js run
alert("Hello");
```
The mini-window with the message is called a *modal window*. The word "modal" means that the visitor can't interact with the rest of the page, press other buttons, etc, un
# Authoring
This describes important stuff about authoring new articles of the tutorial.
## Internal links
All tutorial links should start from the root, not including the domain.
✅ OK:
```md
We'll cover that in the chapter [about functions](/function-basics)
```
❌ Not ok:
```md
We'll cover that in the chapter [about functions](https://javascript.info/function-basics)
```
Also, to reference a chapter, there's a special "info:" scheme, like this:
```md
We'll cover that in the chapter <i
# Average (Mean)
Calculate the average of a list of numbers using mean.
## Applications
Calculating the mean of a list of numbers is one of the most common ways to
determine the average of those numbers.
Calculating a mean would be useful in these situations:
- Determining the average score for all players of a video game level.
- Finding the average grade for tests that a student took this semester.
- Determining the average size of all files in a directory/folder.
## Steps
1. Inp
<!DOCTYPE html>
<html la g="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link rel="stylesheet" href="./prism.css">
<script async defer src="./prism.js"></script>
<!-- Latest compiled
<!-- begin snippet: js hide: false console: true babel: null -->
<!-- language: lang-html -->
<input type="text" onkeyup="myfunction(this.value)">
<script>
function myfunction(value) {
console.log(value)
}
</script>
<!-- end snippet -->
function strip_word_html ( $text, $allowed_tags = '<a><ul><li><b><i><sup><sub><em><strong><u><br><br/><br /><p><h2><h3><h4><h5><h6>' ) {
mb_regex_encoding( 'UTF-8' );
//replace MS special characters first
$search = array( '/‘/u', '/’/u', '/“/u', '/”/u', '/—/u' );
$replace = array( '\'', '\'', '"', '"', '-' );
$text = preg_replace( $search, $replace, $text );
//make sure _all_ html entities are converted to the plain ascii equivalents - it app
// ==UserScript==
// @name Wordswithfriends, Block javascript alerts
// @match http://wordswithfriends.net/*
// @run-at document-start
// ==/UserScript==
addJS_Node (null, null, overrideSelectNativeJS_Functions);
function overrideSelectNativeJS_Functions () {
window.alert = function alert (message) {
console.log (message);
}
}
function addJS_Node (text, s_URL, funcToRun) {
var D = document;
var scriptNode
#!/bin/sh
# lowerit
# convert all file names in the current directory to lower case
# only operates on plain files--does not change the name of directories
# will ask for verification before overwriting an existing file
for x in `ls`
do
if [ ! -f $x ]; then
continue
fi
lc=`echo $x | tr '[A-Z]' '[a-z]'`
if [ $lc != $x ]; then
mv -i $x $lc
fi
done
| Working with DOM | Working with JS | Working With Functions |
| -------------------------|-------------------------|----------------------- |
| [Accessing Dom Elements](#accessing-dom-elements)| [Add/Remove Array Item](#addremove-array-item) | [Add Default Arguments to Function](#add-default-arguments-to-a-function) |
| [Grab Children/Parent Node(s)](#grab-childrenparent-nodes)| [Add/Remove Object Properties](#addremove-object-properties) | [Throttle/Debounce Functions](#thro
===============
While the rest of the country struggles with a job shortage the tech industry has an over abundance of available jobs. This is an attempt to gather as many online job forums as possible for people to reference when in need of some work. Whether you are thinking of moving on to bigger and better things, got laid off, or are looking to pick up some extra freelance work this list will hopefully steer you in the right direction. Chime in if you have any more resources or have expe
# Awesome Interviews [](https://github.com/sindresorhus/awesome)
> A curated list of lists of technical interview questions.
[What makes for an awesome list?](awesome.md)
Please read the [contribution guidelines](contributing.md) or the [creating a list guide](create-list.md) if you want to contribute.
**Check out my [channel](https://t.me/botcube) or [blog](https://medium.com/@Max
# Useful resources for becoming a ninja fullstack developer!
## Web Development
- [Check cross-browser compatibility for CSS, JavaScript and HTML ](https://caniuse.com/#home)
- [Modern front-end Cheatsheets](https://medium.freecodecamp.org/modern-frontend-hacking-cheatsheets-df9c2566c72a)
- [Check out what your favorite company's stack is](https://stackshare.io/)
- [A Guide to Becoming a Full-Stack Developer in 2017](https://medium.com/coderbyte/a-guide-to-becoming-a-full-stack-developer-in-201
## intro
A Promise is a programming construct that can reduce some of the pains of asynchronous programming. Using Promises can help produce code that is leaner, easier to maintain, and easier to build on.
This lesson will mostly focus on ES6 Promise syntax, but will use [Bluebird](https://github.com/petkaantonov/bluebird) since it provides excellent error handling in the browser. The CommonJS syntax will need a bundler like [browserify](https://github.com/substack/node-browserify) or [webpac
'use strict';
/**
* ███████████████═╗ ███████████████═╗ █████████████═╗ █████═╗ █████═╗
* ███████████████ ║ ███████████████ ║ ███████████████ ║ █████ ║ █████ ║
* ╚═══█████ ╔════╝ ╚═══█████ ╔════╝ █████ ╔═════════╝ █████ ║ █████ ║
* █████ ║ █████ ║ █████ ║ █████ ║ █████ ║
* █████ ║ █████ ║ █████████████═╗ ███████████████ ║
* █████ ║ █████ ║ ╚█████████████═╗ ╚███████████ ╔═╝
* █████ ║ █████
# es6-cheatsheet
A cheatsheet containing ES2015 [ES6] tips, tricks, best practices and code
snippet examples for your day to day workflow. Contributions are welcome!
## Table of Contents
- [var versus let / const](#var-versus-let--const)
- [Replacing IIFEs with Blocks](#replacing-iifes-with-blocks)
- [Arrow Functions](#arrow-functions)
- [Strings](#strings)
- [Destructuring](#destructuring)
- [Modules](#modules)
- [Parameters](#parameters)
- [Classes](#classes)
- [Symbols](#symbols)
- [Maps](
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUM
declare module 'fs/promises' {
import {
Stats,
BigIntStats,
StatOptions,
WriteVResult,
ReadVResult,
PathLike,
RmDirOptions,
RmOptions,
MakeDirectoryOptions,
Dirent,
OpenDirOptions,
Dir,
BaseEncodingOptions,
BufferEncodingOption,
OpenMode,
Mode,
} from 'fs';
interface FileHandle {
/**
* Gets the file descriptor for this
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset = UTF-8">
<meta http-equiv="Content-Type" content="text/html">
<meta name="Author" content="Bryan Guner">
<meta name="keywords" content="HTML, Meta Tags, Metadata">
<meta name="description" content="Learning about Web Development.">
<meta name="revised" content="Bryan Guner 4/16/2021">
<meta http-equiv="c
import INST from 'browser-sniffer'
class SafeString {
constructor ( string ) {
this.string = typeof string === 'string' ? string : `${ string }`
}
toString () {
return this.string
}
}
const ENTITIES = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'/': '/',
'`': '`', // for old versions of IE
'=': '=' // in case of unquoted attributes
}
function htmlEscape ( str ) {
// ideally we should wrap this in a SafeString, but t
<!--------------------------------------------------------------Github Corner SVG--------------------------------------------------------------------------------------------------------->
<a class="github-corner" href="https://github.com/bgoonz/Lambda" aria-label="View source on Github"><svg
aria-hidden="true" width="80" height="80" viewBox="0 0 250 250"
style="z-index: 100000; fill:#194ccdaf; color:#fff; position: fixed; top: 20px; border: 0; left: 20px; transfor
{
// Controls whether the editor shows CodeLens.
"diffEditor.codeLens": false,
// When enabled, the diff editor ignores changes in leading or trailing whitespace.
"diffEditor.ignoreTrimWhitespace": true,
// Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.
"diffEditor.maxComputationTime": 5000,
// Controls whether the diff editor shows +/- indicators for added/removed changes.
"diffEditor.renderIndicators": true,
// Controls whether the diff ed
{
//----------------beginning of editor settings--------------------\\
//Controls if empty lines should be ignored with toggle, add or remove actions for line comments.
"editor.comments.ignoreEmptyLines": false,
//emove trailing auto inserted whitespace.
"editor.trimAutoWhitespace": false,
//Controls whether the Go to Definition mouse gesture always opens the peek widget.
"editor.definitionLinkOpensInPeek": true,
//Scrolling speed multiplier when pressing Alt.
"editor.fastScrol
import fnmatch
import os
# constants
PATH = './'
PATTERN = '*.'
def get_file_names(filepath, pattern):
matches = []
if os.path.exists(filepath):
for root, dirnames, filenames in os.walk(filepath):
for filename in fnmatch.filter(filenames, pattern):
# matches.append(os.path.join(root, filename)) # full path
matches.append(os.path.join(filename)) # just file name
if matches:
print("Found {} files:".format(len(matc
#!/usr/bin/env python3
import argparse
import os
import pathlib
import progressbar
import speech_recognition as sr
from pydub import AudioSegment
from pydub.silence import split_on_silence
class AudioToText:
""" Converts an audio file to text. """
def __init__(self, fileInput, fileOutput, language):
""" Initialize. """
self.input = fileInput
self.output = fileOutput
self.language = language
self.minSilenceLen = 500 # The minimu
'''
Generating random strings from regex-like expressions.
Generates sequences of random characters derived from a production
expression with a grammar approximately identical to that used by Regular
Expressions.
This is intended for data-driven testing (fuzzing) of input validators and
parsers that use regex or regex-like semantics.
Example, Generates a Random Email Address:
-- fuzzex.generate( "[a-zA-Z0-9._]+@[a-zA-Z0-9._]+\\\\.[a-z]+" )
Where this program Breaks From Regex:
-- Fuzzex
# Web IDEs
[ideone](https://ideone.com/) Ideone is an online compiler and debugging tool which allows youto compile source code and execute it online in more than 60 programming languages and share links to the code.
[repl.it](https://repl.it) Like ideaone, can also install missing Python packages.
[Onlilne GDB](https://www.onlinegdb.com/) Online compiler and debugger forC, C++, Python, Java, PHP, Ruby, Perl,
Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog, an
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script src="//ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
<!--
TODO:
DONE: Have a "details mode" where we see how we got the frequencies.
- In details mode, have a table / dropdown for you to pick wha
let milliseconds = 0
let centiseconds = 0
let seconds = 0
let running = false
let htmlMS = document.querySelector( "#msTens" )
let htmlCS = document.querySelector( "#msHundreds" )
let htmlS = document.querySelector( "#secondOnes" )
let htmlTS = document.querySelector( "#secondTens" )
let digits = document.querySelector( ".digits" )
let startTimer = function () {
if ( !running ) {
running = true
htmlTS.textContent = 0
htmlS.textContent = 0
myInterval = setInterval( function
<h1 align="center">
<br>
<img width="200" src="https://cdn.rawgit.com/sindresorhus/awesome/master/media/logo.svg" alt="awesome">
<br>
</h1>
# Awesome Hacking Resources  
A collection of hacking / penetration testing resources to make you better!
**Let's make it the biggest resource repository for our community.**
**You are welcome to f
classList.item(index); // Returns the item in the list by its index, or undefined if index is greater than or equal to the list's length
classList.contains(token); // Returns true if the list contains the given token, otherwise false.
classList.add(token1[, ...tokenN]); // Adds the specified token(s) to the list.
classList.remove(token1[, ...tokenN]); // Removes the specified token(s) from the list.
classList.replace(oldToken, newToken); // Replaces token with newToken.
classList.supports(token)
**DO YOU WANT TO BUILD AND WRITE GLORIOUS TECHNICAL DOCUMENTATION FULL TIME? EMAIL mark@helium.com. WE NEED YOU.**
# Beautiful Docs
I love documentation. If you work with/are writing code intended for usage and consumption by more than one person, you should love it, too. Documentation and other resources will make or break the success of your project. And the more open and collaborative you want development to be, the more crucial docs become.
With that in mind, here's a list of docs and oth
var wrappy = require('wrappy')
module.exports = wrappy(once)
module.exports.strict = wrappy(onceStrict)
once.proto = once(function () {
Object.defineProperty(Function.prototype, 'once', {
value: function () {
return once(this)
},
configurable: true
})
Object.defineProperty(Function.prototype, 'onceStrict', {
value: function () {
return onceStrict(this)
},
configurable: true
})
})
function once (fn) {
var f = function () {
if (f.called) return
a
aa
aaa
aah
aahed
aahing
aahs
aal
aalii
aaliis
aals
aam
aani
aardvark
aardvarks
aardwolf
aardwolves
aargh
aaron
aaronic
aaronical
aaronite
aaronitic
aarrgh
aarrghh
aaru
aas
aasvogel
aasvogels
ab
aba
ababdeh
ababua
abac
abaca
abacay
abacas
abacate
abacaxi
abaci
abacinate
abacination
abacisci
abaciscus
abacist
aback
abacli
abacot
abacterial
abactinal
abactinally
abaction
abactor
abaculi
abaculus
abacus
abacuses
abada
abaddon
abadejo
abadengo
abadia
abadite
abaff
abaft
abay
abayah
abaisance
abaise
// !Easy
// Count Length of Cycle
// Election
// Longest Uniform String
// Run Length Encoding
// Search Tree
// Second Smallest
// Walking Robot
// !Moderate
// Best Average Grade
// Longest Word
// Median Two Sorted Arrays
// Snowpack
// Stair Case
// !Hard
// HashMap
// Lowest Price
// Prefix Search
// Easy
// Count Length of Cycle
/**
* Instructions to candidate.
* 1) Run this code in the REPL to observe its behaviour. The
* execution entry point is main().
* 2)
### Count the occurrence of keys and convert the result into array of objects where each object belongs to one key and it's occurrence (count).
#### Example
```js
[
{ language: 'JavaScript' },{ language: 'JavaScript' },{ language: 'TypeScript' },
]
```
#### SHOULD BE CONVERTED TO =
```js
[
{ language: 'JavaScript', count: 2 },
{ language: 'C++', count: 1 },
{ language: 'TypeScript', count: 1 }
]
```
##### The idea is to count the frequency of each unique key in an array of objects and th
function change (coins, amount) {
const combinations = new Array(amount + 1).fill(0)
combinations[0] = 1
for (let i = 0; i < coins.length; i++) {
const coin = coins[i]
for (let j = coin; j < amount + 1; j++) {
combinations[j] += combinations[j - coin]
}
}
return combinations[amount]
}
function minimumCoins (coins, amount) {
// minimumCoins[i] will store the minimum coins needed for amount i
const minimumCoins = new Array(amount + 1).fill(0)
minimumCoins[0] =
var auto = require('run-auto')
var escapeStringRegexp = require('escape-string-regexp')
var model = require('../model')
var values = require('object-values')
var MAX_RESULTS = 8
var MAX_QUERY_LENGTH = 255 // prevent mongoDB exceptions
module.exports = function (app) {
app.get('/autocomplete', function (req, res, next) {
var q = req.query.q
autocomplete(q, function (err, results) {
if (err) return next(err)
res.send({
q: q,
results: results
})
})
//Function to test if a character is alpha numeric that is faster than a regular
//expression in JavaScript
let isAlphaNumeric = (char) => {
char = char.toString();
let id = char.charCodeAt(0);
if (
!(id > 47 && id < 58) && // if not numeric(0-9)
!(id > 64 && id < 91) && // if not letter(A-Z)
!(id > 96 && id < 123) // if not letter(a-z)
) {
return false;
}
return true;
};
console.log(isAlphaNumeric("A")); //true
console.log(isAlphaNumeric(2)); //true
console.log(isA
'use strict';
let fs = require('fs');
let path = require('path');
let log = require('engine/log')();
let glob = require('glob');
let beautify = require('js-beautify');
let readlineSync = require('readline-sync');
module.exports = async function() {
let args = require('yargs')
.usage("Path to tutorial root is required.")
.demand(['root'])
.argv;
let root = fs.realpathSync(args.root);
let options = {
indent_size: 2,
selector_separator_newline: true,
#!/usr/bin/env python2
# -*- coding:utf8 -*-
"""
A simple Python 3.4+ script to send a text message to a Free Mobile phone.
- Warning: it only works in France to a French number, using the mobile operator Free Mobile.
- Warning: some initial configuration is required before running this script (see the error messages).
- Copyright 2014-20 Lilian Besson
- License MIT.
Examples
--------
$ FreeSMS.py --help
Gives help
$ FreeSMS.py "I like using Python to send SMS to myself from my laptop -- and
/* Postitioning */
.center-block {
display: block;
float: none;
margin-left: auto;
margin-right: auto;
}
.text-center {
text-align: center;
}
.text-center .subline {
margin: 0 auto;
max-width: 40rem;
}
/* Visual */
.is-locked {
overflow: hidden;
}
.is-hidden {
display: none;
}
.list--inline {
margin: -.25rem;
}
.list--inline li {
display: inline-block;
margin: .25rem;
}
.list--unstyled {
list-style: none;
margin: 0;
padding: 0;
}
.link--text {
color: var
### __Tools:__
* [git-tip](https://www.npmjs.com/package/git-tip) - A handy CLI to make optimum use of these tips. ([Here in Docker container](https://github.com/djoudi5/docker-git-tip))
P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
<!-- @doxie.inject start toc -->
<!-- Don’t remove or change the comment above – that can break automatic updates. -->
* [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so)
* [Show helpful guides that come wi
const test = require('ava');
const { tmpdir } = require('os');
const { join } = require('path');
const { spawn } = require('child_process');
const { access } = require('fs').promises;
const { readFileSync } = require('fs');
const { constants: FS_CONSTANTS } = require('fs');
const command = join(__dirname, '..', 'extract-media');
const helpText = readFileSync(join(__dirname, '..', 'help.txt'), 'utf8');
function testMediaExtraction(t, { testFileName, expectedMediaFileName }) {
retu
This repo links to solutions of [Projects](https://github.com/thekarangoel/Projects) written by other users in any language. See [how to contribute](https://github.com/thekarangoel/Projects/blob/master/CONTRIBUTING.md) to this repo.
=========================================
Numbers
---------
**Find PI to the Nth Digit** - Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go. [[MrBlaise (Python)]](https://github.com/MrBlais
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo -u postgres createuser --interactive
sudo -u postgres createdb database1
//col class
export class Column {
constructor(columnSquares, currentColor) {
this.counter = 5;
this.columnSquares = columnSquares;
this.currentColor = currentColor;
this.rowArr = [null, null, null, null, null, null];
}
add(playerTurn) {
// this.rowArr.unshift(playerTurn);
for (let i = 5; i >= 0; i--) {
if (this.rowArr[i] === null) {
this.rowArr[i] = playerTurn;
break;
}
}
import { Game, CurrentPlayer } from './game.js';
import { GameJsonSerializer, GameJsonDeSerializer } from './save-state.js';
let game = undefined;
if (localStorage.getItem("data") !== null) {
let loadedData = new GameJsonDeSerializer(localStorage.getItem("data")).deSerialize();
game = loadedData;
game = new Game(game.player1, game.player2)
console.log(game)
}
//main
let updateUI = () => {
if (!game) {
document
.getElementById("board-hold
import { Game, CurrentPlayer } from './game.js';
import { GameJsonSerializer, GameJsonDeSerializer } from './save-state.js';
let game = undefined;
if (localStorage.getItem("data") !== null) {
let loadedData = new GameJsonDeSerializer(localStorage.getItem("data")).deSerialize();
game = loadedData;
game = new Game(game.player1, game.player2)
console.log(game)
}
//main
let updateUI = () => {
if (!game) {
document
.getElementById("board-holder")
# Welcome to Cacher
We're delighted you've chosen Cacher to be your snippet organizer! Whether you're a solo developer or a member of your team, Cacher is here to help you organize and use snippets more efficiently.
Our users create snippets to:
- Remember project-specific algorithms
- Create cheatsheets for useful libraries
- Share knowledge with colleagues
Take a few minutes to look over our **Getting Started** snippets. To view more detailed information on features, you can visit [Cacher
# Snippets
Snippets can be used to remember many different pieces of information. Here are a few tips on using them in Cacher.
## Markdown

[Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) is one of the most widely used snippet types in Cacher for documentation. We've added a few enhancements to make it even more useful.
To create a Markdown snippet, simply give your snippet file a `.md` extension or c
# Labels
Labels let you categorize your snippets by purpose and assist in retrieving them later on. Assign nested, color-coded labels to your snippets to maximize productivity.

## Creating a label
1. In the left-hand sidebar, click the + button under **Labels**.
2. Enter a **Label Title**.
3. Pick one of the **preset colors** or enter a hex value to define a custom color.
4. Choose whether the label will be **Private**.
5. If you
# Teams
A team allows you and your colleagues to collaborate on a shared library of snippets and labels. They are the best way to disseminate best practices and onboard new team members.
## Team libraries
Every team has its own library, comprised of snippets and labels. Any **owner**, **member** or **manager** is able to view and contribute snippets to the library. In addition, any changes to the team library will be synced to teammates signed into Cacher.
## Starting a Team
 - Easily search, insert and create snippets within IntelliJ-based IDEs like IDEA, PhpStorm and Rubymine.
- [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=Cacher.cacher-vscode) - Create snippets from selected text and insert them quickly with our powerfu
# Sharing
Every snippet in Cacher has a corresponding page on [Snippets](https://snippets.cacher.io/), our community hub for sharing code. The page's visibility is dependent on whether the snippet is **public or private** and the **Privacy Setting** for the page.
Here are a few examples of snippet pages:
- [Markdown Task Lists in Cacher](https://snippets.cacher.io/snippet/108f62b6b8d8dd18610c)
- [Svelte is really fast](https://snippets.cacher.io/snippet/37dc3da63ce006296521)
- [DigitalOcean Ra
LMD example for issue #105
## Goal: TypeScript-style tooling in Svelte
Getting TS in Svelte might be a blocker for some, but I think the underlaying advantage comes in that the TS tools are just a stricter version of the JS tools. Everyone using Svelte gets improvements in tooling from this, not just folks with TS.
### Three main steps:
1. Migrate [svelte-preprocess](https://github.com/kaisermann/svelte-preprocess/issues) into core (and/or take enough functionality that it's not needed)
2. Create "svelte/svelte-langua
```
root
├── packages
│ ├── node-app
│ │ └── package.json
│ └── library
│ └── package.json
├── babel.config.js
├── lerna.json
└── package.json
```
import React from 'react'
import PropTypes from 'prop-types'
const InputNumber = (props = {}) => {
const {
handleChange = () => {},
...otherProps
} = props
const onKeyDown = (e = {}) => {
const {
ctrlKey,
metaKey,
key = '',
target = {}
} = e
const { type } = target
if (
!ctrlKey &&
!metaKey &&
type === 'number' &&
key.length === 1 &&
(/[^0-9.]/g).test(key)
) {
e.preventDefault()
}
}
c
// @flow
const crypto = require('crypto');
module.exports = WebpackStableChunkHash;
function WebpackStableChunkHash() {}
WebpackStableChunkHash.prototype.apply = function(compiler) {
//
// For a while, webpack has had issues with [chunkhash] being unstable and not reflecting the actual
// md5 of the module.
//
// While stable, deterministic builds are one issue, the biggest issue with [chunkhash] is that it runs too
// early, before optimization. This means that a change to your o
componentDidMount(){
fetch("https://jsonbin.io/b/59f721644ef213575c9f6531")
.then( response => response.json())
.then( data => { this.setState({posts: data})});
}
const { executionAsyncId, createHook } = require('async_hooks')
const {writeSync} = require('fs')
const {format} = require('util')
const err = (...msg) => writeSync(2, format(...msg) + '\n')
const log = (...msg) => writeSync(1, format(...msg) + '\n')
const hook = createHook({
init (eid, type) {
// err('INIT', eid, type)
},
before () {
//err('BEFORE', executionAsyncId())
},
after () {
//err('AFTER', executionAsyncId())
},
destroy () {
//err('DESTROY', executionAsyn
@function rkv-map-merge($maps...) {
$collection: ();
@each $map in $maps {
$collection: map-merge($collection, $map);
}
@return $collection;
}
class BaseJobResource(Resource):
def dispatch_request(
self, provider: str, owner_name: str, repo_name: str, build_number: int, job_number: int, *args, **kwargs
) -> Response:
queryset = Job.query.join(Build, Build.id == Job.build_id).join(
Repository, Repository.id == Build.repository_id
).filter(
Repository.provider == RepositoryProvider(provider),
Repository.owner_name == owner_name,
Repository.name == repo_name,
# source: https://raw.githubusercontent.com/prof-rossetti/rock-paper-scissors-py/master/app/game.py
import random
GUI_WINDOW_TITLE = "Rock-Paper-Scissors"
WELCOME_MESSAGE = "Hi. Welcome to my Rock-Paper-Scissors game!"
GUI_PROMPT_MESSAGE = "Please choose an option from the dropdown:"
WIN_MESSAGE = "Congratulations, you won!"
LOSE_MESSAGE = "Oh, the computer won. It's ok."
TIE_MESSAGE = "Oh, it's a tie."
def random_choice(options=["rock", "paper", "scissors"]):
return random.choice(option
package problems.java.strings;
public class Palindrome
{
static boolean isPalindrome(String s)
{
int left = 0, right = s.length() - 1;
while(left < right)
{
if(s.charAt(left) != s.charAt(right))
{
return false;
}
left++;
right--;
}
return true;
}
static int lengthOfLongestPalindrome(String s)
{
int max = Integer.MIN_VALUE;
for(int i = 0; i <
# -*- coding: utf-8 -*-
class PagesDataStore(object):
def __init__(self, db):
self.db = db
pass
def add_link_to_crawl(self, url):
"""Add the given link to `links_to_crawl`."""
pass
def remove_link_to_crawl(self, url):
"""Remove the given link from `links_to_crawl`."""
pass
def reduce_priority_link_to_crawl(self, url):
"""Reduce the priority of a link in `links_to_crawl` to avoid cycles."""
pass
def extract
# Write a method, pow(base, exponent), that takes in two numbers.
# The method should calculate the base raised to the exponent power.
# You can assume the exponent is always positive.
#
# Solve this recursively!
#
# Examples:
#
# pow(2, 0) # => 1
# pow(2, 1) # => 2
# pow(2, 5) # => 32
# pow(3, 4) # => 81
# pow(4, 3) # => 64
def pow(base, exponent)
return 1 if exponent == 0
base * pow(base, exponent - 1)
end
# Write a method, lucas_number(n), that takes in a number.
# The method should ret
/* jshint esversion: 6 */
// Solve the following prompts using recursion.
// 1. Calculate the factorial of a number. The factorial of a non-negative integer n,
// denoted by n!, is the product of all positive integers less than or equal to n.
// Example: 5! = 5 x 4 x 3 x 2 x 1 = 120
// factorial(5); // 120
var factorial = function(n) {
if (n <= 1) {
return 1;
} else {
return n * factorial(n - 1)
}
};
// 2. Compute the sum of an array of integers.
// sum([1,2,3,4,5,6]); // 21
var
#############################################
# compiled from github.com/github/gitignore #
#############################################
### Custom ###
*.db
*.sqlite
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Networ
# Do nothing for non-interactive shells.
[ -z "$PS1" ] && return
echo ' ___ ___ ___ ___ '
echo ' /\ \ /\ \ /\__\ /\ \ '
echo ' \:\ \ _\:\ \ /:/ / \:\ \ '
echo ' /::\__\ /\/::\__\ /:/__/ /::\__\'
echo ' /:/\/__/ \::/\/__/ \:\ \ /:/\/__/'
echo ' \/__/ \:\__\ \:\__\ \/__/ '
echo ' \/__/ \/__/ '
echo ' '
echo ' '
# Misc Al
.row {
width: 100%;
margin-bottom: 0px !important;
}
.row .col {
float: none !important;
margin: 5% auto !important;
}
#task, #filter {
background-color: white;
border-radius: 10px;
padding-left: 10px;
}
#filter {
margin-top: 15px;
}
.card-title {
text-align: center;
font-size: 2.5rem !important
}
.btn, .save-tasks, .clear-tasks {
border-radius: 10px !important;
-webkit-appearance: none !important;
}
.card {
border-radius: 10px !important
/*!
* jQuery JavaScript Library v3.5.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2020-04-10T15:07Z
*/
( function( global, factory ) {
"use strict";
if ( typeof module === "object" && typeof module.exports === "object" ) {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory a
-----------------------------------------------------------------
## Appearance
The outward or visible aspect of a website.
+ **Animation**: The process of creating motion and shape change.
+ **[Animate.css](http://daneden.github.io/animate.css/)**: Just-add-water CSS animations.
+ **[Animate.less](https://github.com/machito/animate.less)**: A bunch of cool, fun, and cross-browser animations converted into LESS for you to use in your Bootstrap projects.
+ **[Anime.js](https://gi
# The Mega Full-Stack Web Development Resource Guide
-------
* Why is this guide a thing?
* About this (long) guide
Development Resources
---------------------
* Text Editors/IDEs
* Terminals/Shells
* Browsers
Client-Side / Frontend Resources
--------------------------------
* HTML
* CSS
* JavaScript
* TypeScript
* Frontend JavaScript Frameworks
* Client-Side APIs
* WebAssembly
Server-Side / Backend Resources
-------------------------------
* JavaScript Runtime
Mega Project List
========
A list of practical projects that anyone can solve in any programming language (See [solutions](https://github.com/thekarangoel/Projects-Solutions)). These projects are divided in multiple categories, and each category has its own folder.
To get started, simply fork this repo.
## [CONTRIBUTING](https://github.com/thekarangoel/Projects/blob/master/CONTRIBUTING.md)
See ways of [contributing](https://github.com/thekarangoel/Projects/blob/master/CONTRIBUTING.md) to thi
Check project
2. Add lazy sizes
<script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/4.1.5/lazysizes.min.js"></script>
3. Replace src attr in img
<img data-src="assets/images/flower1.jpg" class="lazyload"/>
<img data-src="assets/images/flower2.jpg" class="lazyload"/>
<img data-src="assets/images/flower3.png" class="lazyload"/>
<img data-src="assets/images/flower4.png" class="lazyload"/>
<img data-src="assets/images/flower5.jpg" class="lazyload"/>
<img data-src="assets/images/flower6.jpg
'use strict';
const childProcess = require('child_process');
const fs = require('fs');
const path = require('path');
function getFiles(cppDir) {
return fs
.readdirSync(cppDir)
.filter(function (item) {
const fullPath = path.join(cppDir, item);
return fs.lstatSync(fullPath).isDirectory();
})
.map(function (dirname) {
const fullPath = path.join(cppDir, dirname);
return fs
.readdirSync(fullPath)
function replaceWords( str, before, after ) {
if ( /^[A-Z]/.test( before ) ) {
after = after[ 0 ].toUpperCase() + after.substring( 1 )
} else {
after = after[ 0 ].toLowerCase() + after.substring( 1 )
}
return str.replace( before, after )
}
console.log( replaceWords( "Let us go to the store", "store", "mall" ) ) //"Let us go to the mall"
console.log( replaceWords( "He is Sleeping on the couch", "Sleeping", "sitting" ) ) //"He is Sitting on the couch"
console.log( replaceWords( "Hi
/*Function to check how many times an alpha-numeric character occurs in a string.
Case insensitive. */
let isAlphaNumeric = ( char ) => {
char = char.toString();
let id = char.charCodeAt( 0 );
if (
!( id > 47 && id < 58 ) && // if not numeric(0-9)
!( id > 64 && id < 91 ) && // if not letter(A-Z)
!( id > 96 && id < 123 ) // if not letter(a-z)
) {
return false;
}
return true;
};
let countChars = ( string ) => {
let obj = {};
for ( let char of string ) {
if ( i
const slugify = str =>
str
.toLowerCase ()
.trim ()
.replace (/[^\w\s-]/g, '')
.replace (/[\s_-]+/g, '-')
.replace (/^-+|-+$/g, '');
# Prerequisites of Computer Programming
[](https://hits.seeyoufarm.com)
- History of Computer Programming Languages
<https://cs.brown.edu/~adf/programming_languages.html>
- Hardware & Software
<https://www.computerhope.com/issues/ch000039.htm>
- Low-Leve
# Electronics Mini-Library
[](https://hits.seeyoufarm.com)
- [Baud Rate And Bandwidth](#baud-rate-and-bandwidth)
- [Cathode And Anode](#cathode-and-anode)
- [Circuit Board](#circuit-board)
- [Digital And Analog Signals](#digital-and-analog-signals)
- [Input And Output]
# Core Concepts of Computer Programming
TOC
1. [Intro](#intro)
2. [Input / Output](#input-and-output)
1. [Hello World Program](#hello-world-program)
3. [Variables & Data Types](#variables-and-data-types)
1. [Sample Program for Variables and Data Types](#sample-program-for-variables-and-data-types)
4. [Operators](#operators)
1. [Assignment Operators Sample Program](#assignment-operators-sample-program)
2. [Arithmetic Operators Sample Program](#arithmetic-operators-sample-program
# Hacking The Github Stats
[](https://hits.seeyoufarm.com)
The [GitHub Stats](https://github.com/anuraghazra/github-readme-stats)
is an external service to display your ranking based on commits, PRs,
issues etc. You just simply need the URL and change the details,
include i
# free-for.dev
Developers and Open Source authors now have a massive amount of services offering free tiers, but it can be hard to find them all to make informed decisions.
This is a list of software (SaaS, PaaS, IaaS, etc.) and other offerings that have free tiers for developers.
The scope of this particular list is limited to things that infrastructure developers (System Administrator, DevOps Practitioners, etc.) are likely to find useful. We love all the free services out there, but it wou
const fs = require("fs");
const path = require("path");
const fm = require("front-matter");
const {
CONTENT_ROOT,
CONTENT_TRANSLATED_ROOT,
VALID_LOCALES,
} = require("../content");
const { SearchIndex } = require("../build");
function* walker(root) {
const dirents = fs.readdirSync(root, { withFileTypes: true });
for (const dirent of dirents) {
// Doing it this way is faster than doing `path.join(root, dirent.name)`
const filepath = `${root}${path.sep}${dirent.name}`;
if
<h1 align="center">
<br>
<a href="https://github.com/leonardomso/33"><img src="https://i.imgur.com/dsHmk6H.jpg" alt="33 Concepts Every JS Developer Should Know" width=200"></a>
<br>
<br>
33 Concepts Every JavaScript Developer Should Know
<br><br>
</h1>
<p align="center">
<a href="http://makeapullrequest.com">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome">
</a>
<a href="https://opensource.org/licenses/MIT">
<img
## Query Selector
In place of common selectors like class, id or attribute we can use `document.querySelector` or `document.querySelectorAll` for substitution. The differences lie in:
* `document.querySelector` returns the first matched element
* `document.querySelectorAll` returns all matched elements as NodeList. It can be converted to Array using `Array.prototype.slice.call(document.querySelectorAll(selector));`
* If there are no elements matched, jQuery and `document.querySelectorAll` will
# Modern JavaScript cheatsheet
## Introduction
### Motivation
This document is a cheatsheet for JavaScript you will frequently encounter in modern projects and in most contemporary sample code.
This guide is not intended to teach you JavaScript from the ground up, but to help developers with basic knowledge who may struggle to get familiar with modern codebases (or let's say to learn React for instance) because of the JavaScript concepts used.
Besides, I will sometimes provide personal tips
#!/usr/bin/env bash
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
alias d="cd ~/Documents/Dropbox"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias p="cd ~/projects"
alias g="git"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no
/*<](https://airtable.com/shrzMhx00YiIVAWJg)
[](https://gitter.im/jlevy/the-art-of-command-line?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
- [Meta](#meta)
- [Basics](#basics)
- [Everyday use](#everyday-use)
- [Processing files and data](#processin
🌍
*[Čeština](README-cs.md) ∙ [Deutsch](README-de.md) ∙ [Ελληνικά](README-el.md) ∙ [English](README.md) ∙ [Español](README-es.md) ∙ [Français](README-fr.md) ∙ [Indonesia](README-id.md) ∙ [Italiano](README-it.md) ∙ [日本語](README-ja.md) ∙ [한국어](README-ko.md) ∙ [Português](README-pt.md) ∙ [Română](README-ro.md) ∙ [Русский](README-ru.md) ∙ [Slovenščina](README-sl.md) ∙ [Українська](README-uk.md) ∙ [简体中文](README-zh.md) ∙ [繁體中文](README-zh-Hant.md)*
# The Art of Command Line
[ {
for (var key in obj) {
if (fn.call(thisArg, obj[key], key, obj) === false) {
break;
}
}
};
# Awesome Knowledge Graph [](https://awesome.re)
> A curated list of Knowledge Graph related learning materials, databases, tools and other resources
## Contents
* [Infrastructure](#infrastructure)
* [Graph Databases](#graph-databases)
* [Triple Stores](#triple-stores)
* [Graph Computing Frameworks](#graph-computing-frameworks)
* [Graph Visualization](#graph-visualization)
* [Languages](#languages)
* [Managed Hosting Services](#managed-host
// Create a class for the element
class WordCount extends HTMLParagraphElement {
constructor() {
// Always call super first in constructor
super();
// count words in element's parent element
const wcParent = this.parentNode;
function countWords(node){
const text = node.innerText || node.textContent;
return text.split(/\s+/g).length;
}
const count = `Words: ${countWords(wcParent)}`;
// Create a shadow root
const shadow = this.attachShadow({mod
import _ from 'lodash';
function trimString(s) { return s.trim(); }
function getEdgeName(nodeFrom, nodeTo) {
return _([nodeFrom, nodeTo]).map(trimString).join(' -> ');
}
function getEdgeNames(nodeA, nodeB) {
return [
getEdgeName(nodeA, nodeB),
getEdgeName(nodeB, nodeA),
];
}
export class Graph {
constructor(options) {
this.nodes = {};
this.edges = [];
if (options) {
if (_.isArray(options.nodes)) {
_.forEach(options.nodes, this.addNode.bind(this));
import _ from 'lodash';
import {Graph} from './graph';
function getVariable(nodeA, nodeB) {
return 'I(' + nodeA + ', ' + nodeB + ')';
}
function generateEquations(graph, nodeStart, nodeEnd) {
let components;
graph.iterateNodes(function (node, value) {
if (node !== nodeStart && node !== nodeEnd) {
components = [];
graph.iterateAdjacent(node, function (nodeAdj, value) {
components.push(getVariable(node, nodeAdj));
});
console.log(components.join(' + ')
[regex golf](https://alf.nu/RegexGolf)
[audio-guy](https://github.com/cwilso)
[dev blog](https://www.codeblocq.com)
const isInteger = Number.isInteger || (v => typeof v === 'number' && isFinite(v) && Math.floor(v) === v);
function mostSignificantBit(value) {
let result = value;
result |= result >> 1;
result |= result >> 2;
result |= result >> 4;
result |= result >> 8;
result |= result >> 16;
result |= result >> 32;
result -= result >> 1;
return result;
}
/**
* Class BinaryIndexedTree
*/
class BinaryIndexedTree {
/**
* @param {Object} options
* @param {number} options.maxVal -
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-do
////////////////////////////
// Filter projects by id //
////////////////////////////
document.addEventListener('DOMContentLoaded', (event) => {
const languages = {
javascript: false,
node: false,
express: false,
mysql: false,
vue: false,
react: false,
bootstrap: false,
sass: false,
css: false
};
const scroller = true;
const projectContainer = document.querySelector('.project-container');
const projectScroller = document.querySelector('.project-
<?php
/* SETTINGS */
$recipient = "your.email@gmail.com";
$subject = "New Message from Contact Form";
if($_POST){
/* DATA FROM HTML FORM */
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
//$phone = $_POST['phone'];
/* SUBJECT */
$emailSubject = $subject . " by " . $name;
/* HEADERS */
$headers = "From: $name <$email>\r\n" .
"Reply-To: $name <$email>\r\n" .
"Subject: $emailSubject\r\n" .
"Content-type:
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION AN
'use strict';
/* eslint no-invalid-this: 1 */
const ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
const slice = Array.prototype.slice;
const toStr = Object.prototype.toString;
const funcType = '[object Function]';
export default function bind(that) {
const target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
const args = slice.call(arguments, 1);
let bound;
con
import path from 'path';
import fs from 'fs';
class Mime {
constructor() {
// Map of extension -> mime type
this.types = Object.create(null);
// Map of mime type -> extension
this.extensions = Object.create(null);
}
/**
* Define mimetype -> extension mappings. Each key is a mime-type that maps
* to an array of extensions associated with the type. The first extension is
* used as the default extension for the type.
*
* e.g. mime.define({'audio/ogg', ['oga
var path = require('path');
var fs = require('fs');
var _0777 = parseInt('0777', 8);
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
function mkdirP (p, opts, f, made) {
if (typeof opts === 'function') {
f = opts;
opts = {};
}
else if (!opts || typeof opts !== 'object') {
opts = { mode: opts };
}
var mode = opts.mode;
var xfs = opts.fs || fs;
if (mode === undefined) {
mode = _0777
}
if (!made) made = null;
'use strict';
import fs from 'fs';
import union from 'union';
import ecstatic from 'ecstatic';
import auth from 'basic-auth';
import httpProxy from 'http-proxy';
import corser from 'corser';
import path from 'path';
import secureCompare from 'secure-compare';
// a hacky and direct workaround to fix https://github.com/http-party/http-server/issues/525
function getCaller() {
try {
const stack = new Error().stack;
const stackLines = stack.split('\n');
const callerStack = stackLines[
Bubble Sort Visualizer
----------------------
Visual explanation of how bubble sort works. Built using Vue.js.
A [Pen](https://codepen.io/bgoonz/pen/WNRPbMz) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/WNRPbMz/license).
Iconifying Content - Dashboard
------------------------------
Concept for an analytics dashboard. Click the various metrics to see detailed graphs with more data.
Blog post: [Iconifying Content](http://codersblock.com/blog/iconifying-content/)
A [Pen](https://codepen.io/bgoonz/pen/VwPgYQa) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/VwPgYQa/license).
#!/usr/bin/env bash
version="0.2.1"
# search directory defaults to current
dir=.
# Exclude directories
exclude="! -path '*/.git*' ! -path '*/.hg*' ! -path '*/.svn*'"
# case sensitive search
sensitive=
# colors enabled by default in ttys
if [ -t 1 ]; then
colors=1
else
colors=
fi
# show matches by default
showmatches=1
# file name pattern
filename=
# line numbers shown by default
linenums=1
# ansi colors
cyan=$(echo -e '\033[96m')
reset=$(echo -e '\033[39m')
# max line length
mline=
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
for i in r.json():
call(['git', 'clone', i['git_pull_url']])
description_file = './{0}/description.txt'.format(i['id'])
with open(description_file, 'w') as f:
f.write('{0}\n'.format(i['description']))
# free-for.dev
Developers and Open Source authors now have a massive amount of services offering free tiers, but it can be hard to find them all to make informed decisions.
This is a list of software (SaaS, PaaS, IaaS, etc.) and other offerings that have free tiers for developers.
The scope of this particular list is limited to things that infrastructure developers (System Administrator, DevOps Practitioners, etc.) are likely to find useful. We love all the free services out there, but it wou
[✔]: assets/images/checkbox-small-blue.png
# Node.js Best Practices
<h1 align="center">
<img src="assets/images/banner-2.jpg" alt="Node.js Best Practices">
</h1>
<br/>
<div align="center">
<img src="https://img.shields.io/badge/⚙%20Item%20count%20-%20102%20Best%20Practices-blue.svg" alt="102 items"> <img id="last-update-badge" src="https://img.shields.io/badge/%F0%9F%93%85%20Last%20update%20-%20March%2027%2C%202021-green.svg" alt="Last update: March 27, 2021"> <img src="https://img.shiel
---
###### 1. What's the output?
```javascript
function sayHi() {
console.log(name);
console.log(age);
var name = 'Lydia';
let age = 21;
}
sayHi();
```
- A: `Lydia` and `undefined`
- B: `Lydia` and `ReferenceError`
- C: `ReferenceError` and `21`
- D: `undefined` and `ReferenceError`
<details><summary><b>Answer</b></summary>
<p>
#### Answer: D
Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space i
### Index
* [ABAP](#abap)
* [Ada](#ada)
* [Agda](#agda)
* [Alef](#alef)
* [Android](#android)
* [APL](#apl)
* [Arduino](#arduino)
* [ASP.NET](#aspnet)
* [ASP.NET Core](#aspnet-core)
* [Blazor](#blazor)
* [Assembly Language](#assembly-language)
* [Non-X86](#non-x86)
* [AutoHotkey](#autohotkey)
* [Autotools](#autotools)
* [Awk](#awk)
* [Bash](#bash)
* [Basic](#basic)
* [BETA](#beta)
* [C](#c)
* [C#](#c-sharp)
* [C++](#cpp)
* [Chapel](#chapel)
* [Cilk](#cilk)
* [Clojure](#clojure)
* [COBOL](#c
Inspire [](https://github.com/sindresorhus/awesome)
===
Designing and building a modern frontend in any web project can be a long and arduous process. Here's a collction of links to help you. Enjoy!
## Concept
<h5>These sites are good to get a general idea of possible layouts and style paths to take.</h5>
* [TheBestDesigns](https://www.thebestdesigns.com/) - General list of hand pic
# Prototypes in JS
## Initial steps
Let's review the basics of objects in JavaScript.

This way of making an object is simplest. You can just read the code for an object like this and immediately understand it. Its defining curly brackets contain properties, which follow the format `key: value`. Objects help us label and group together data in a way that other data structures can't. Arrays, for instance, would have a hard time accounting for the color, model, VIN
# Awesome Node.js projects [](https://github.com/sindresorhus/awesome)
> A curated list of awesome open-source applications made with Node.js. See [Awesome Node.js](https://github.com/sindresorhus/awesome-nodejs)
for a curated list of packages and resources.
> [Read the story of how this repository ranked first on Hacker News and reached the 1000+ stars on Github.](https://medium.com
# Design Resources
A curated list of design resources from design templates, stock photos, icons, colors, and much more

## Table of Contents
- [General](#general)
- [Colors](#colors)
- [Illustrations](#illustrations)
- [Stock Photos](#stock-photos)
- [Icons](#icons)
### General
Website | Description
--------|------------
[Freebiesbug](https://freebiesbug.com/) | Hand-picked resources for web designer and developers, constantly updated.
[Sketch App Source
# Project Based Tutorials in C
A list of tutorials that work towards the making of small to large projects in C.
## Table of Contents
* [Computer Architecture](#computer-architecture)
* [Computer Networking](#computer-networking)
* [Databases](#databases)
* [Game Development](#game-development)
* [Operating Systems](#operating-systems)
* [Programming Languages](#programming-languages)
* [Uncategorized](#uncategorized)
## Computer Architecture
* [Bitwise](https://github.com/pervognsen/bitwis
11. bottomVisible
This snippet checks whether the bottom of a page is visible.
const bottomVisible = () =>
document.documentElement.clientHeight + window.scrollY >=
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
bottomVisible(); // true
### Table of Contents
| No. | Questions |
|---- | ---------
|1 | [Generate a random number in a given range](#How-to-generate-a-random-number-in-a-given-range) |
|2 | [Find the difference between two arrays](#How-to-find-the-difference-between-two-arrays)|
|3 | [Convert truthy/falsy to boolean(true/false)](#Convert-truthy-falsy-to-boolean)|
|4 | [Repeat a string](#Repeat-a-string)|
|5 | [Check how long an operation takes](#Check-how-long-an-operation-takes)|
|6 | [Two ways to remove an it
# The Art of Command Line
*Note: I'm planning to revise this and looking for a new co-author to help with expanding this into a more comprehensive guide. While it's very popular, it could be broader and a bit deeper. If you like to write and are close to being an expert on this material and willing to consider helping, please drop me a note at josh (0x40) holloway.com. –[jlevy](https://github.com/jlevy), [Holloway](https://www.holloway.com). Thank you!*
- [Meta](#meta)
- [Basics](#basics)
- [
const runPromisesInSeries = ps =>
ps.reduce( ( p, next ) => p.then( next ), Promise.resolve() );
//--------------------------------
const delay = d => new Promise( r => setTimeout( r, d ) );
runPromisesInSeries( [ () => delay( 1000 ), () => delay( 2000 ) ] );
// Executes each promise sequentially, taking a total of 3 seconds to complete
import { getProviderStatusAsync, LocationProviderStatus } from 'expo-location';
import { useState } from 'react';
import { Platform } from 'react-native';
import useInterval from 'use-interval';
const useLocationProviderStatus = (delay: number = 2000) => {
const [locationProviderAvailable, setLocationProviderAvailable] = useState<boolean | undefined>(undefined);
const getLocationProviderStatus = ({
gpsAvailable,
networkAvailable,
passiveAvailable,
}: LocationProviderStatus):
const hyphenateText = ( text, breakpoint ) => {
if ( text.length > breakpoint ) {
const words = text.split( ' ' );
return words.map( ( word ) => {
if ( word.length > breakpoint ) {
const head = word.substr( 0, breakpoint );
const tail = word.substr( breakpoint );
return `${head} -${tail}`;
}
return word;
} ).join( ' ' );
}
return text;
}
type BST = {
key: number;
value: string;
left: BST | false;
right: BST | false;
} | false;
const BST0: BST = false;
const BST1: BST = {
key: 1,
value: "abc",
left: false,
right: false,
}
const BST4: BST = {
key: 4,
value: "dcj",
left: {
key: 7,
value: "ruf",
left: false,
right: false,
},
right: false,
};
const BST3: BST = {
key: 3,
value: "ilk",
left: BST1,
right: BST4,
};
const BST42: BST = {
key: 42,
value: "ily",
left: {
key: 27,
# Completely uninstall node + npm:
* go to `/usr/local/lib` and delete any node and node_modules
* go to `/usr/local/include` and delete any node and node_modules directory
* if you installed with `brew install node`, then run `brew uninstall node` in your terminal
Check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
go to `/usr/local/bin` and delete any node executable.
You may need to do the additional instructions as well:
```sh
const asEnumeration = dictionary => Object.freeze( {
from( value ) {
if ( dictionary[ value ] ) {
return dictionary[ value ];
}
throw Error( `Invalid enumeration value ${value}` );
}
} );
const getEvenNumbers = limit => includeIfConditionIsMet( limit, number => number % 2 === 0 );
const getOddNumbers = limit => includeIfConditionIsMet( limit, number => number % 2 !== 0 );
const includeIfConditionIsMet = ( limit = 10, predicate ) => {
return ( function inner( array, numb
import NetInfo, { NetInfoState, NetInfoSubscription } from '@react-native-community/netinfo';
import { useState, useRef, useEffect } from 'react';
const useDeviceOnlineStatus = () => {
const [online, setOnline] = useState(false);
const unsubscribeRef = useRef<NetInfoSubscription | undefined>();
useEffect(() => {
unsubscribeRef.current = NetInfo.addEventListener((state: NetInfoState) => {
setOnline(state.isConnected);
});
return () => {
unsubscribeRef?.current &&
const mapKeys = ( collection, rootKey ) => {
const obj = {};
collection.forEach( item => {
obj[ item[ rootKey ] ] = item;
} );
return obj;
};
const justins = [ {
id: 1,
name: 'Justin Bieber'
}, {
id: 2,
name: 'Justin Timberlake'
}, {
id: 3,
name: 'Justin Time'
} ];
mapKeys( justins, 'id' );
// {
// 1: {id: 1, name: 'Justin Bieber'},
// 2: {id: 2, name: 'Justin Timberlake'},
// 3: {id: 3, name: 'Justin Time'}
//}
# Front-end Developer Interview Questions
Interview questions and resources for recruiting senior front-end developers
### Table of Contents
- [Front-end Developer Interview Questions](#front-end-developer-interview-questions)
- [Table of Contents](#table-of-contents)
- [HTML](#html)
- [CSS and Preprocessors](#css-and-preprocessors)
- [JavaScript](#javascript)
- [Technical JavaScript questions](#technical-javascript-questions)
- [Responsive Design](#responsive-design)
- [Prob
//(Rule-based sentence boundary segmentation) - chop given text into its proper sentences.
// Ignore periods/questions/exclamations used in acronyms/abbreviations/numbers, etc.
// @spencermountain 2015 MIT
const sentence_parser = text => {
const sentences = [];
//first do a greedy-split..
const chunks = text.split( /(\S.+?[.\?!])(?=\s+|$|")/g );
//honourifics
let abbrevs = [ "jr", "mr", "mrs", "ms", "dr", "prof", "sr", "sen", "corp", "rep", "gov", "atty", "supt", "det", "rev", "col", "
const generateIncrementedNumbersList = ( min, max, increment, includeMin ) => {
const items = [];
let incrementor = Math.max( min, increment );
if ( includeMin ) {
items.push( min );
}
while ( incrementor <= max ) {
items.push( incrementor );
incrementor += increment;
}
return items;
}
console.log( generateIncrementedNumbersList( 500, 10000, 1000, true ) );
// [ 500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000 ]
console.log( generateIncrementedNumbe
const wait = async (ms: number) =>
new Promise<void>((resolve) => {
setTimeout(() => resolve(), ms);
});
await wait(10000); // wait for 10 seconds
export { };
// Continue...
//add a new content-security-policy to the page
function addTag( content ) {
var meta = document.createElement( 'meta' );
meta.httpEquiv = "Content-Security-Policy";
meta.content = content
document.getElementsByTagName( 'head' )[ 0 ].appendChild( meta );
}
//try to add a <script> tag
function addScript( src ) {
var s = document.createElement( 'script' );
s.setAttribute( 'src', src );
s.onload = () => {
console.log( nlp )
}
document.body.appendChild( s );
}
//try a remote
const add = ( a, b ) => a + b;
const add10 = num => add( num, 10 );
const add200 = num => add( num, 200 );
const addNew = a => b => a + b;
console.log( add( 10, 20 ) ) // 30
console.log( add10( 10 ) ) // 20
console.log( addNew( 10 )( 20 ) ) // 30
console.log( add200( 10 ) ) // 210
const compose = ( ...args ) => target => {
return args.reduceRight( ( previousFn, currentFn ) => {
return currentFn( previousFn );
}, target );
};
console.log( 'output',
compose(
add10,
add200,
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE
function doubleList(listOfNumbers: number[]): number[] {
if(!listOfNumbers.length) return [];
return [
double(listOfNumbers[0]),
...doubleList(listOfNumbers.slice(1, listOfNumbers.length))
];
}
function double(n: number) {
return n * 2;
}
console.log(doubleList([1,2,3,4,5])) // [2,4,6,8,10]
const wait = async (ms: number) =>
new Promise((resolve) => {
setTimeout(() => resolve(), ms);
});
await wait(10000); // wait for 10 seconds
// Continue...
function moneyRawValue(value = 0, decimalSeparator = ",") {
if (typeof value === "number") {
return value;
}
const rawValue = parseFloat(
value
.replace(/\((?=\d+)(.*)\)/, "-$1")
.replace(new RegExp(`[^0-9-${decimalSeparator}]`, "g"), "")
.replace(decimalSeparator, ".")
);
return !isNaN(rawValue) ? rawValue : 0;
}
/*
Test on how are JS's switch-cases are working.
I was in an argument w/ someone saying they turn into jumptables,
so I coded this up quickly to check.
With a few calls (so JIT won't kick in) it is clear that this executes
every case every time we enter the switch, so it is clear that jump tables
are not used in general, but they still might be used as an optional optimization,
but only when possible.
*/
function test(x) {
switch (x) {
case (_=>{console.log("TEST 1"); return 1;})()
from pdf2image import convert_from_path
title = input("Pdf files name: ")
def menu():
global quality
print("""
Image format:
1. Very High Resolution - 700 dpi
2. High Resolution - 500 dpi
3. Medium Resolution - 300 dpi
4. Low Resolution - 100 dpi
5. Very Low Resolution - 50 dpi
""")
while True:
choice = input('Choose One: ')
quality = 700 if choice == '1' else 500 if choice == '2' else 300 if choice == '3' el
-- sqlbolt.com first five lessons solutions
-- 1 lesson
SELECT title FROM movies;
SELECT director FROM movies;
SELECT title, director FROM movies;
SELECT title, year FROM movies;
SELECT * FROM movies;
-- 2 lesson
SELECT * FROM movies WHERE id = 6;
SELECT * FROM movies WHERE year BETWEEN 2000 AND 2010;
SELECT * FROM movies WHERE year NOT BETWEEN 2000 AND 2010;
SELECT * FROM movies WHERE id BETWEEN 1 AND 5;
-- 3 lesson
SELECT * FROM movies WHERE title LIKE "Toy Story%";
SELECT * FROM movies WHE
## Array
- [ ] [Two Sum](https://leetcode.com/problems/two-sum/)
- [ ] [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)
- [ ] [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/)
- [ ] [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/)
- [ ] [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/)
- [ ] [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-
## Exercise 1
1. Extract the contents of the zip file into a new directory and open the folder in VSCode.
2. Initialise a new Node app in the directory. The entry point should be the existing `server.js`.
3. Install Express.
4. Create an Express app in `server.js` that listens on port 3000.
5. Create a new request in Postman to make sure that the server is working.
## Exercise 2
1. Create a `GET /profiles/eric` endpoint that returns the data about Eric Cartman in JSON format.
2. Create a `GET
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<center>\n",
" <img src=\"https://gitlab.com/ibm/skills-network/courses/placeholder101/-/raw/master/labs/module%201/images/IDSNlogo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n",
"</center>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# **Web Scraping Lab**\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Estimated t
React.useEffect(() => {
let animationFrame = 0
function virtualScroller(targets, { offset, topOffset, bottomOffset } = {}) {
offset ??= 0
topOffset ??= offset ?? 0
bottomOffset ??= offset ?? 0
cancelAnimationFrame(animationFrame)
animationFrame = window.requestAnimationFrame(() => {
for (let x = 0, len = targets.length; x < len; x++) {
let target = targets[x]
const { top, bottom } = target.getBoundingClientRect()
//
// +----------+ <- offset
// |//
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'MEIRYO'
plt.rcParams["font.size"] = 18
w, h, dpi = 1920, 1080, 144
fig = plt.figure(figsize=(w / dpi, h / dpi), dpi=dpi, facecolor='white')
x = np.arange(-0.2, 7, 0.001)
y1 = 3 * np.sin(x)
y2 = 2.3 * np.sin(x )
plt.xticks(np.linspace(0, np.pi * 2.5, num=6, endpoint=True))
plt.yticks(np.linspace(-11, 11, num=23, endpoint=True))
plt.grid(True)
plt.plot(x, y1, label="電流")
plt.plot(x, y2, label='両端電圧')
plt.legen
class User {
constructor ({ name = 'Anonymous' }) {
this.name = name;
}
login () {
console.log(`${ this.name } logged in.`);
}
};
class Student extends User {
constructor (options) {
super(options);
this.completedLessons = [];
}
completeLesson (id) {
this.completedLessons.push(id);
console.log(`${ this.name } completed lesson: ${ id }`);
}
}
const echo = new Student({
name: 'Echo'
});
echo.login(); // "Echo logged in."
echo.completeLesson(1); // "Echo
# React Developer Roadmap
> Roadmap to becoming a React developer in 2021:
Below you can find a chart demonstrating the paths that you can take and the libraries that you would want to learn to become a React developer. I made this chart as a tip for everyone who asks me, "What should I learn next as a React developer?"
## Disclaimer
> The purpose of this roadmap is to give you an idea about the landscape. The road map will guide you if you are confused about what to learn next, rather than e
{"cells":[{"cell_type":"markdown","metadata":{},"source":["<center>\n"," <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n","</center>\n","\n","# Write and Save Files in Python\n","\n","Estimated time needed: **25** minutes\n","\n","## Objectives\n","\n","After completing this lab you will be able to:\n","\n","- Write to files using Python libraries\
from flask import Flask, render_template, request, redirect, url_for
from dbfunctions import add_new_task, get_complete_tasks, get_incomplete_tasks, mark_task_complete
app = Flask(
__name__,
template_folder = 'client/templates'
)
@app.route('/')
def index():
complete = get_complete_tasks()
incomplete = get_incomplete_tasks()
return render_template('index.html', complete=complete, incomplete=incomplete)
@app.route('/add', methods=["POST"])
def add():
task =
function exponentialBackoff(i, dt) {
const f = j => j >= 0 ? Math.exp(j/3)*dt : 0
const ret = f(i)-f(i-1)
if(ret < dt) {
return dt
} else {
return ret
}
}
function retryCheck(test, callback, failedCallback, max_retries, max_wait_time, i) {
max_retries = typeof max_retries === 'undefined' ? 20 : max_retries;
max_wait_time = typeof max_wait_time === 'undefined' ? 30000 : max_wait_time;
i = typeof i === 'undefined' ? 0 : i;
console.log(" retryCheck max_retries = %s, max_
def remove_instance(nums, val):
"""
Given an array nums, and a value val, returns the new length of the array with the value removed
i.e. the number of items in nums with val
Input: nums=[5, 2, 2, 5, 3] and val = 5
Output: 3
"""
try:
#check for cases of an empty array
if len(nums) == 0:
return 0
else:
count=0
for i in nums:
if i != val:
count +=1
return count
getDiscountPercentageValue(products: Product[]): number {
let discountValue = 0;
if (products.length === 1) {
return 0;
}
let allProductsQuantity = products.reduce((sum, product) => sum + product.quantity, 0);
if (allProductsQuantity > 10 && allProductsQuantity <= 50) {
discountValue += 10;
} else if (allProductsQuantity > 50) {
discountValue += 15;
}
// ......
// The rest of b
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<center>\n",
" <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n",
"</center>\n",
"\n",
"# Dictionaries in Python\n",
"\n",
"Estimated time needed: **20** minutes\n",
"\n",
"## Objectives\n",
"\n",
"After completing this lab you
number = int(input())
counter =0
while number > 0:
number = number//10
print(number)
counter +=1
print("number of digits :",counter)
with open("model_dictionary.json",'w') as f:
json.dump(model_dict,f)
f.close()
with open("company_dictionary.json",'w')as f:
json.dump(company_dict,f)
f.close()
with open("fuelType_dictionary.json",'w') as f:
json.dump(fueltype_dict,f)
f.close()
with open("transmission_dictionary.json",'w')as f:
json.dump(transmission_dict,f)
f.close()
with open("vitals_dictionary.json",'w')as f:
json.dump(vals,f)
f.close()
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<center>\n",
" <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-PY0101EN-SkillsNetwork/IDSNlogo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n",
"</center>\n",
"\n",
"# String Operations\n",
"\n",
"Estimated time needed: **15** minutes\n",
"\n",
"## Objectives\n",
"\n",
"After completing this lab you will
import { Component } from "react"
import './Table.css';
class TableComponent extends Component{
render(){
return(
<div>
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Dell</td>
<td>Abhi Agarwal</td>
<td>India</td>
import re
def get_file_content(include_tag):
file_name = include_tag.split(" ")[1].replace('"', "")
return open(file_name).read()
def main():
"""
Lets dont worry about the program
Its basically replacing <include file.svg> with its file content
in the same file and produces final_car.svg as output
This is purely to show, how we can work with multiple files in out git repository.
"""
with open('car_assemble.svg') as file: # reading source file car_assemble
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<center>\n",
" <img src=\"https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/Logos/organization_logo/organization_logo.png\" width=\"300\" alt=\"cognitiveclass.ai logo\" />\n",
"</center>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1>Extracting Stock Data Using a Python Library</h1>\n"
]
},
{
"cell_type": "markdown",
runByFeatures(features) {
if (features.type !== "Feature") return undefined;
let polygon = turf.polygon(features.geometry.coordinates);
const unitsOption = {units: 'kilometers'};
let polyline, length, bbox, percentage1, percentage2, fraction, point1, point2, bearing;
let point1a, point1b, point2a, point2b, line1, line2;
let largest, diagonalLength;
polyline = turf.polygonToLineString(polygon);
length = turf.length(polyline, unitsOption);
bbox = turf.bbox(pol
// Given an array nums, and a value val, write a function to remove
// all instances of val from the array and return the new length
const removeValInstances = (arr, val) => {
if(!arr) return 0;
if(!Array.isArray(arr)) return 0;
if(!val) return arr.length;
let newArrLength = 0;
for(let i = 0; i < arr.length; i++) {
if(arr[i] === val) continue;
newArrLength++;
}
return newArrLength;
}
removeValInstances(['i', 'e', 'd'], 'i'); //2
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
{
"city": "Los Angeles",
"growth_from_2000_to_2013": "4.8%",
"latitude": 34.0522342,
"longitude": -118.2436849,
"population": "3884307",
"rank": "2",
"state": "California"
},
{
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset = UTF-8" />
<meta http-equiv="Content-Type" content="text/html">
<meta name="Author" content="Bryan Guner">
<meta name="keywords" content="HTML, Meta Tags, Metadata" />
<meta name="description" content="Learning about Web Development." />
<meta name="revised" content="Bryan Guner 4/16/2021" />
<meta http-equiv="cookie" content="userid
.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter span {
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
outline: 0 !important;
background: none !important;
text-align: left !important;
float: none !important;
vertical-align: baseline !important;
position: static !important;
left: auto !important;
top: auto !important;
right: auto !important;
bottom: auto !important;
height: auto !important;
width: auto !important;
line-hei
# History control
# don't use duplicate lines or lines starting with space
HISTCONTROL=ignoreboth
HISTSIZE=1000
HISTFILESIZE=2000
# append to the history file instead of overwrite
shopt -s histappend
# Aliases
alias cp='cp -Rv'
alias ls='ls --color=auto -ACF'
alias ll='ls --color=auto -alF'
alias grep='grep --color=auto'
alias grepw='grep --color=auto -Hrnwi'
alias mkdir='mkdir -pv'
alias mv='mv -v'
alias weather='curl wttr.in/?0'
alias wget='wget -c'
alias tree="tree -aI 'test*|.git|node_modul
```
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: bryan
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.72-microsoft-stand
/*
func: An anonymous function.
*/
function ( param ) {}
//-------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------
/*
jqAfter: Insert content, specified by the parameter, after each element in the set of matched elements.
*/
$( selector ).after( content );
//-------------------------------------------------------------
|23:13:13|bryan@LAPTOP-9LGJ3JGS:[~] ~_exitstatus:0__________________________________________________________o>
apt list --installed
Listing... Done
accountsservice/focal-updates,focal-security,now 0.6.55-0ubuntu12~20.04.4 amd64 [installed,automatic]
acl/focal,now 2.2.53-6 amd64 [installed,automatic]
adduser/focal,now 3.118ubuntu2 all [installed,automatic]
adwaita-icon-theme/focal-updates,now 3.36.1-2ubuntu0.20.04.2 all [installed,automatic]
alsa-topology-conf/focal,now 1.2.2-1 all [installed,au
<a class="bookmarklet_button"
href="javascript:(function(){f='https://www.addtoany.com/share#url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title);a=function(){if(!window.open(f,'addtoany','width=800,height=600,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"
title="AddToAny"
onclick="a
# Arrayzing - The JavaScript array cheatsheet
This is a work-in-progress cheatsheet for JS arrays. Please feel free to leave a comment if this has helped you or you would like to suggest anything.
* [Create an array](#user-content-create-an-array)
* [Empty an array](#user-content-empty-an-array)
* [Clone an array](#user-content-clone-an-array)
* [Get last item](#user-content-get-last-item)
* [Remove first item](#user-content-remove-first-item)
* [Remove last item](#user-content-remove-last-ite
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bo
<header class="header">
<div class="topbar clearfix">
<div class="container">
<div class="row-fluid">
<div class="col-md-6 col-sm-6 text-left">
<p>
<strong><i class="fa fa-phone"></i></strong> +551-254-5505
<strong><i class="fa fa-envelope"></i></strong> <a class="btn" id="email-nav"
href=" https://mail.google.com/mail/u/0/h/ ">bryan.guner@gmail.com</a>
const { expect } = require('chai');
const adjacencyList = require('./small-graph');
const expectedResults = require('./small-results');
const largeAdjacencyList = require('./large-graph');
const largeExpectedResults = require('./large-results');
const assert = require('assert')
let areTheyConnected = () => {
throw new Error('Could not load areTheyConnected');
};
try {
({ areTheyConnected } = require('../01-are-they-connected'));
} catch (e) {}
function randomNamesIndex() {
return Math.
const fs = require('fs');
const path = require('path');
const matter = require('gray-matter');
const ObjectID = require('bson-objectid');
const { parseMDSync } = require('../challenge-parser/parser');
const padWithLeadingZeros = originalNum => {
/* always want file step numbers 3 digits */
return ('' + originalNum).padStart(3, '0');
};
const insertErms = (seedCode, erms) => {
const lines = seedCode.split('\n');
if (Number.isInteger(erms[0])) {
lines.splice(erms[0], 0, '--fcc-editab
const path = require('path');
const { availableLangs } = require('../../config/i18n/all-langs');
const translationsSchema = require('./locales/english/translations.json');
const trendingSchema = require('./locales/english/trending.json');
const motivationSchema = require('./locales/english/motivation.json');
const introSchema = require('./locales/english/intro.json');
const metaTagsSchema = require('./locales/english/meta-tags.json');
const linksSchema = require('./locales/english/links.json');
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html">
<meta name="Author" content="Bryan Guner">
<title> Lambda Student Resources</title>
<link type="image/x-icon"
href="https://instructure-uploads-pdx.s3.us-west-2.amazonaws.com/account_168550000000000001/attachments/536/favicon_lambda_32.png"
rel="shortcut icon">
<link
href="https://instructure-uploads-p
/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
/* Styles */
}
/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
//caesarCipher algorithm using modern javascript
//Objective: to shift every letter in given string by give number.
//even negative value of number
//only string with spaces are allowed for now.
let caesarCipher = (str, num) => {
num = num % 26; //IMP to convert numbr > or < 26
let lowercaseString = str.toLowerCase();
let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
let newString = '';
for (let i = 0; i < lowercaseString.length; i++) {
let currentLetter = lowe
# Quick JavaScript Array Functions Practice
Want to learn how to use JavaScript array functions like map, reduce, filter, etc? Use this worksheet and the corresponding videos to figure out how!
## Sample Data
Here's a sample piece of Star Wars data from the [Star Wars API](https://swapi.dev/).
```javascript
const characters = [
{
name: 'Luke Skywalker',
height: '172',
mass: '77',
eye_color: 'blue',
gender: 'male',
},
{
name: 'Darth
// collapse burger menu panel in mobile view
const html = document.querySelector('html');
const body = document.querySelector('body');
const themeButtons = document.querySelectorAll('.theme');
const themeNavInput = document.querySelectorAll('#theme-nav');
const themeNavBtn = document.querySelectorAll('.theme-nav-btn');
const themeEmojis = document.querySelectorAll('label[for*="theme"] > .emoji');
const mediaQueryMobile = 600;
const burgerCheckBox = document.querySelector('.burger-checkbox-clas
Convert to ES6 Syntax Challenge
-------------------------------
A [Pen](https://codepen.io/jamesqquick/pen/qMXYGb) by [James Quick](https://codepen.io/jamesqquick) on [CodePen](https://codepen.io).
[License](https://codepen.io/jamesqquick/pen/qMXYGb/license).
Full-screen Popup with Flexbox
------------------------------
A [Pen](https://codepen.io/bgoonz/pen/qBRpQNy) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/qBRpQNy/license).
fetch-api-basics
----------------
A [Pen](https://codepen.io/bgoonz/pen/gOgoQrN) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/gOgoQrN/license).
// Convert the Following from ES5 to ES6 Syntax
// 1. Convert the function to an ES6 Arrow Function
const golden = () => {
console.log("this is golden!!!!");
}
golden()
// 2. Simplify the following with es6 enhanced object literals
const newFunction = function literal(firstName, lastName){
return {
firstName,
lastName,
fullName: () => {
console.log(firstName + " " + lastName)
return;
}
}
}
newFunction("William", "Imoh").fullName()
// 3. Condense this to 8 li
/*
Problem - Translate the provided string to pig latin.
Pig Latin takes the first consonant (or consonant cluster), which may occur at any place in the word, of an English word, moves it to the end of the word and suffixes an "ay".
SO, If the first character is a vowel, then take that whole word and add 'way' at the end. Otherwise comes the tricky part, take the consonant(s) before the first vowel and move it to the end and add 'ay'.
If a word begins with a vowel you just add "way" to the en
<meta name="x-ua-compatible" content="IE=edge,chrome=1" http_equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=6">
<meta name="msapplication-tap-highlight" content="no">
<meta name="theme-color" content="#E21836F">
<meta content="article" property="og:type">
<meta content="218456798186610" property="fb:app_id">
<meta content="https://www.facebook.com/popularmechanics" property="article:publisher">
<meta name="twitter:site" content="@PopMech"
Canvas Sparkly Circle Loader
----------------------------
A [Pen](https://codepen.io/bgoonz/pen/ExZxMPN) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/ExZxMPN/license).
/* https://leetcode.com/discuss/interview-question/542597/ */
function topKeywords(reviews, keywords, k) {
keywords = keywords.map((w) => w.toLowerCase()); // case the keywords
const reviewsFlattened = reviews
.map((rev) => {
return rev
.toLowerCase() // case the review
.split(" ") // split it into words
.filter((w) => keywords.includes(w)); // filter keywords
})
.reduce((acc, cv) => {
const encounteredWords = []; // kee
// Step 1: Setup Folders
// Create an actions and a reducers folder. Then add an index.js file in both folders.
// Required dependency installs: axios, redux, react-redux, redux-thunk
************************************************
// Step 2: Create Redux Config File
// @ Root of application create a <config>.js file.
import { createStore } from 'redux';
import reducer from './src/reducers';
const configRedux = () => createStore(reducer);
export default configRedux;
!!--------------------
## Table of Contents
- [GitHub](#github)
- [Ignore Whitespace](#ignore-whitespace)
- [Adjust Tab Space](#adjust-tab-space)
- [Commit History by Author](#commit-history-by-author)
- [Cloning a Repository](#cloning-a-repository)
- [Branch](#branch)
- [Compare all Branches to Another Branch](#compare-all-branches-to-another-branch)
- [Comparing Branches](#comparing-branches)
- [Compare Branches across Forked Repositories](#compare-branches-across-forked-repo
/* eslint-disable class-methods-use-this */
/* eslint-disable object-shorthand */
class LinkedList {
constructor() {
this.head = null;
this.tail = null;
this.count = 0;
// Do not modify anything inside of the constructor
}
// Wraps the given value in a node object and adds the node to the tail of the list
// If the list is empty, the new element is considered the tail as well as the head
// If there is one element in the list before the new element is added, the new e
<html itemscope="" itemtype="https://schema.org/QAPage" class="html__responsive"><head>
<title>javascript - jQuery Tips and Tricks - Stack Overflow</title>
<link rel="shortcut icon" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196">
<link rel="apple-touch-icon" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a">
<link rel="image_src" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple
# .bashrc
# Source global definitions
if [ -f ~/fbStuff.sh ]; then
. ~/fbStuff.sh
fi
export EDITOR=vim
source ~/git-completion.bash
function parse_git_branch {
git symbolic-ref HEAD 2> /dev/null | cut -d '/' -f 3
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local WHITE="\[\033[1;37m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
from os import system as sys
from time import sleep as slp
import curses
import os
import sys
def s(str):
for letter in str:
sys.stdout.write(letter)
sys.stdout.flush()
slp(0.05)
print()
def slow(str):
for letter in str:
sys.stdout.write(letter)
sys.stdout.flush()
slp(0.005)
print()
def cr():
print("\033c",end="",flush=True)
def t():
slp(1.5)
cr()
#keep this comment or else I'll report you: made by IndyRishi and Wilke000
s("Hello! Welcome to my quiz!")
impo
<details><summary>Tutorials for Learning Core Java</summary>
<p>
- [Greenfoot Introducting Java using 2d Animation](https://www.greenfoot.org/doc/joy-of-code)
- [Princenton On-line Textbook](https://introcs.cs.princeton.edu/java/home/)
- [How To Do It In Java](https://howtodoinjava.com)
- [W3 School Java Tutorial](https://www.w3schools.com/java/)
- [Udacity Introduction to Java Course](http://horstmann.com/sjsu/cs046/)
- [Java Review in 60 Minutes](https://youtu.be/3Ky9MZyL8r4)
- [The Official
## Contents
- [Platforms](#platforms)
- [Programming Languages](#programming-languages)
- [Front-End Development](#front-end-development)
- [Back-End Development](#back-end-development)
- [Computer Science](#computer-science)
- [Big Data](#big-data)
- [Theory](#theory)
- [Books](#books)
- [Editors](#editors)
- [Gaming](#gaming)
- [Development Environment](#development-environment)
- [Entertainment](#entertainment)
- [Databases](#databases)
- [Media](#media)
- [Learn](#learn)
- [Security](#secu
<div align="center">
<div>
<img width="500" src="media/logo.svg" alt="Awesome Node.js">
</div>
<br>
<p>
## Contents
- [Official](#official)
- [Packages](#packages)
- [Mad science](#mad-science)
- [Command-line apps](#command-line-apps)
- [Functional programming](#functional-programming)
- [HTTP](#http)
- [Debugging / Profiling](#debugging--profiling)
- [Logging](#logging)
- [Command-line utilities](#command-line-utilities)
- [Build tools](#build-tools)
- [Hardware](#hardware)
```md
<h1 align="center">Hi 👋, I'm Bryan</h1>
---
<div align="center">

</div>
---
<div align="center" style=" border: 1px solid black">
<img align="center" src="https://github.com/bgoonz/bgoonz/blob/master/circle-small-sharp.png?raw=true?raw=true" ></img>
</div>
---
<div align="center">
<img align="center" src="https://readme-jokes.vercel.app/api" stye="width:500; height:320;">
#### Refresh the
The base URL is <https://cdn.jsdelivr.net/gh/{username}/{repo}/>, where you replace {username} with the GitHub username and {repo} with the repository name for the project. Append that URL with the path to the file you want to access in the project.
1. The base URL is `https://cdn.jsdelivr.net/gh/{username}/{repo}/`, where you replace `{username}` with the GitHub username and `{repo}` with the repository name for the project.
2. Append that URL with the path to the file you want to access in
'use strict';
var isWindows = process.platform === 'win32';
// Regex to split a windows path into three parts: [*, device, slash,
// tail] windows-only
var splitDeviceRe =
/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
// Regex to split the tail part of the above into [*, dir, basename, ext]
var splitTailRe =
/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
var win32 = {};
// Function to split a filename into [root, dir, basename, ext]
function
# My Starred Repositories:
- [ ] 1. [https://github.com/waldyrious/cheat.sh](https://github.com/waldyrious/cheat.sh)
- [ ] 2. [https://github.com/waldyrious/crocks](https://github.com/waldyrious/crocks)
- [ ] 3. [https://github.com/waldyrious/learnGitBranching](https://github.com/waldyrious/learnGitBranching)
- [ ] 4. [https://github.com/waldyrious/docsify ](https://github.com/waldyrious/docsify)
- [ ] 5. [https://github.com/dandavison/calc-II ](https://github.com/dandavison/calc-II)
- [ ] 6.
#!/bin/bash
USER=${1:-bgoonz}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
for PAGE in `seq $PAGES`; do
curl -sH "Accept: application/vnd.github.v3.star+json" "https://api.github.com/users/$USER/starred?per_page=100&page=$PAGE"|jq -r '.[]|[.starred_at,.repo.full_name]|@tsv'
done
echo
# curl -sI https://api.github.com/users/$USER/starred?p
from __future__ import unicode_literals
import weakref
from datetime import date, datetime
from functools import wraps
from ..compat import string_types, quote, PY2
# parts of URL to be omitted
SKIP_IN_PATH = (None, "", b"", [], ())
def _escape(value):
"""
Escape a single value of a URL string or a query parameter. If it is a list
or tuple, turn it into a comma-separated string first.
"""
# make sequences into comma-separated stings
if isinstance(value, (list, tuple)
const fs = require('fs')
const path = require('path')
const npm = require('./npm.js')
const color = require('ansicolors')
const output = require('./utils/output.js')
const usageUtil = require('./utils/usage.js')
const { promisify } = require('util')
const glob = promisify(require('glob'))
const readFile = promisify(fs.readFile)
const didYouMean = require('./utils/did-you-mean.js')
const { cmdList } = require('./utils/cmd-list.js')
const usage = usageUtil('help-search', 'npm help-search <text>')
SUMMARY OF LESS COMMANDS
Commands marked with * may be preceded by a number, N.
Notes in parentheses indicate the behavior if N is given.
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
h H Display this help.
q :q Q :Q ZZ Exit.
---------------------------------------------------------------------------
MOVING
e ^E j ^N CR * Forward one line (or N lines).
y ^Y k ^K ^P * Backwar
#!/bin/bash
# finding files with locate and updatedb
LC_ALL=C sudo /Users/paulirish/.homebrew/bin/gupdatedb --prunepaths="/tmp /var/tmp /.Spotlight-V100 /.fseventsd /Volumes/MobileBackups /Volumes/Volume /.MobileBackups"
which glocate > /dev/null && alias locate=glocate
locate navbar
# listing all useragent from your logs
zcat ~/path/to/access/logs* | awk -F'"' '{print $6}' | sort | uniq -c | sort -rn | head -n20000
zcat logs/paulirish.com/http/access.log* | awk -F'"' '{print $6}' | sort |
# won't last long but will give you 1G.
sudo rm /private/var/vm/sleepimage
# Clean up system logs and temporary files
# http://www.thexlab.com/faqs/maintscripts.html
sudo periodic daily weekly monthly
# remove old homebrew versions
# https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md#how-do-i-uninstall-old-versions-of-a-formula
brew cleanup -n # to see what would get cleaned up
brew cleanup # to do it.
cask cleanup
~/Library/Caches/Google/Chrome Canary/Default
*-chrome-mac.zip
third_party/WebKit/Source/devtools/front_end/audits2/lighthouse/renderer/logger.js
third_party/WebKit/Source/devtools/front_end/audits2/lighthouse/renderer/report-ui-features.js
# working files
.vim/viminfo
.vim/swaps/*
.vim/undo
# git credential file
.gitconfig.local
# no thx
node_modules
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
.Trashes
# Compiled Python fil
---
---
<div align="center">
</div><h1 id="⦿-francis-williams-⦿"><strong><em>⦿ <a href="https://www.oneideaaway.com/coach/francis-x-williams">Francis Williams</a> ⦿</em></strong></h1>
<p><a href="#source"><img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/colored.png" alt="-----------------------------------------------------"></a></p>
<h1 id="➤-navigation">➤ Navigation:</h1>
<div align="center">
</div><p><img src="./Francis.gif" alt="nav"></p>
<p><a href="#sou
<!--lint disable no-literal-urls-->
<p align="center">
<a href="https://nodejs.org/">
<img
alt="Node.js"
src="https://nodejs.org/static/images/logo-light.svg"
width="400"
/>
</a>
</p>
Node.js is an open-source, cross-platform, JavaScript runtime environment. It
executes JavaScript code outside of a browser. For more information on using
Node.js, see the [Node.js Website][].
The Node.js project uses an [open governance model](./GOVERNANCE.md). The
[OpenJS Foundatio
<form>
<input type="button" value="Go back!" onclick="history.back()">
</form>
! function ( t ) {
if ( "object" == typeof exports && "undefined" != typeof module ) module.exports = t();
else if ( "function" == typeof define && define.amd ) define( [], t );
else {
var e;
e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, e.Clipboard = t()
}
}( () => {
var t;
var e;
var n;
return function t( e, n, o ) {
function i( c, a ) {
if ( !n[ c ] ) {
if ( !e[ c ] ) {
# Markdown Badges
Add badges to your Profile and Projects.
## How to Use
- Copy the appropriate `<img>` element and paste it in your Markdown file (e.g., `README.md`)
## Shortcuts
- [Markdown Badges](#markdown-badges)
- [How to Use](#how-to-use)
- [Shortcuts](#shortcuts)
- [Programming Languages](#programming-languages)
- [Frameworks](#frameworks)
- [Design](#design)
- [Version Control](#version-control)
- [Social](#social)
- [Education](#education)
- [De
# Contributing to Music Theory projects
A big welcome and thank you for considering contributing to Music Theoryopen source projects! It's people like you that make it a reality for users in our community.
Reading and following these guidelines will help us make the contribution process easy and effective for everyone involved. It also communicates that you agree to respect the time of the developers managing and developing these open source projects. In return, we will reciprocate that respec
# Website Header Design in 2020: Best Practices and Examples
> The header plays a key role in the design of a website and sets the tone for its every other aspect. Especially now in the era of…
[](https://medium.com/@eshokurova?source=post_page-----1992f80ddd69--------------------------------)


{
//----------------beginning of editor settings--------------------\\
//Controls if empty lines should be ignored with toggle, add or remove actions for line comments.
"editor.comments.ignoreEmptyLines": false,
//emove trailing auto inserted whitespace.
"editor.trimAutoWhitespace": false,
//Controls whether the Go to Definition mouse gesture always opens the peek widget.
"editor.definitionLinkOpensInPeek": true,
//Scrolling speed multiplier when pressing Alt.
"editor.fastScrol
// @ts-check
let example0: any = 45;
let example1: boolean | number = 35;
let example2: boolean = true;
let example3: number = 35;
let example4: string = 'Hello World';
let example5: undefined = undefined;
let example6: null = null;
let example7: number;
class Bear {
constructor(age) {
this.age: number = age;
}
}
const bear = new Bear(3)
if (bear instanceof Bear) {
console.log(bear.age)
}
let notastring: any = 'stringy';
console.log(<string> notastring)
console.log(notastring as st
.breadcrumbs-container,
.document-toc-container,
.language-toggle,
.on-github,
.page-footer,
.page-header-main,
nav.sidebar,
ul.prev-next {
display: none !important
}
.main-page-content,
.main-page-content pre {
padding: 2px
}
.main-page-content pre {
border-left-width: 2px
}
.fancybox-margin {
margin-right: 0px;
}
.token.cdata,
.token.comment,
.token.doctype,
.token.prolog,
.token.punctuation {
color: #626262
}
.token.namespace {
opacity: .7
}
.token.boolean,
.token.constant,
## Links
<p align="center">
<a href="mailto:bryan.guner@gmail.com"><img src="https://img.icons8.com/color/96/000000/gmail.png" alt="email"/></a><a href="https://www.facebook.com/bryan.guner/"><img src="https://img.icons8.com/color/96/000000/facebook.png" alt="facebook"/></a><a href="https://twitter.com/bgooonz"><img src="https://img.icons8.com/color/96/000000/twitter-squared.png" alt="twitter"/></a><a href="https://www.youtube.com/channel/UC9-rYyUMsnEBK8G8fCyrXXA/videos"><img src="https://img
# Awesome Productivity [](https://github.com/sindresorhus/awesome)
> A curated list of delightful productivity resources.
Inspired by the [awesome](https://github.com/sindresorhus/awesome) list thing.
## Table of Content
- [Websites](#websites)
- [Online Courses](#online-courses)
- [Books](#books)
- [Tools and Apps](#tools-and-apps)
- [File Management](#file-management)
- [Note
module.exports = {
/**
* Formats arrays:
* - quotes around strings in arrays
* - square brackets around arrays
* - adds commas appropriately (with spacing)
* designed to be used recursively
* @param {any} input - The output to log.
* @returns Formatted output as a string.
*/
formatArray: function(input) {
'use strict';
var output = '';
for (var i = 0, l = input.length; i < l; i++) {
if (typeof input[i] === 'strin
<div align="center">
<img height="60" src="https://img.icons8.com/color/344/javascript.png">
<h1>JavaScript Questions</h1>
</div>
---
###### 1. What's the output?
```javascript
function sayHi() {
console.log(name);
console.log(age);
var name = 'Lydia';
let age = 21;
}
sayHi();
```
- A: `Lydia` and `undefined`
- B: `Lydia` and `ReferenceError`
- C: `ReferenceError` and `21`
- D: `undefined` and `ReferenceError`
<details><summary><b>Answer</b></summary>
<p>
#### Answer: D
With
# Public APIs [](https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Run+tests%22) [](https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Validate+links%22)
A collective list of free APIs for use in software and web development.
## Index
* [Animals](#animals)
# Awesome Competitive Programming [](https://github.com/sindresorhus/awesome)
A curated list of awesome `Competitive Programming`, `Algorithm` and `Data Structure` resources.
Created with a view to connecting people to information, this list below contains a complete collection of all the fantastic resources I've collected over the course of my 11-year competitive programming career.
// ============================================================================
// Implementation Exercise: Singly Linked List
// ============================================================================
//
// -------
// Prompt:
// -------
//
// Implement a Singly Linked List and all of its methods below!
//
// ------------
// Constraints:
// ------------
//
// Make sure the time and space complexity of each is equivalent to those
// in the table provided in the Time and Space Complexity Ana
function getNodeById(nodeId) {
let nodeToReturn;
nodes.forEach(node => {
if (node._id === nodeId) {
nodeToReturn = node;
return;
}
});
return nodeToReturn;
}
nodes.forEach(tempNode => {
tempNode.isVisited = false;
});
function breadthFirstTraverseNodes() {
let queue = [];
let rootNode = nodes[0];
<!DOCTYPE html>
<html>
<head>
<title>_baseCreate.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<style>
/*--------------------- Typography ----------------------------*/
@font-face {
font-family: 'aller-light';
src: url('public/fonts/aller-light.eot');
src: url('public/fonts/aller-light.eot?#iefix') format(
Interactive Spectrogram in the browser!
Same as example in: https://github.com/vlandham/spectrogramJS - but in blocks.
Click 'analyze' to play the sound and create spectrogram.
Uses web audio api.
Also uses D3 with canvas to display the main visualization.
# Markdown Badges
Add badges to your Profile and Projects.
## How to Use
- Copy the appropriate `<img>` element and paste it in your Markdown file (e.g., `README.md`)
## Shortcuts
- [Markdown Badges](#markdown-badges)
- [How to Use](#how-to-use)
- [Shortcuts](#shortcuts)
- [Programming Languages](#programming-languages)
- [Frameworks](#frameworks)
- [Design](#design)
- [Version Control](#version-control)
- [Social](#social)
- [Education](#education)
- [De
1. - ✅ [ Gatsby ](https://www.gatsbyjs.com/ )
2. - ✅ [ React ](https://reactjs.org/)
3. - ✅ [ Parse Hub ]( https://www.parsehub.com/ )
4. - ✅ [ Angolia ]( https://www.algolia.com/developers/ )
5. - ✅ [ ]( )
6. - ✅ [ ]( )
7. - ✅ [ ]( )
8. - ✅ [ ]( )
9. - ✅ [ ]( )
10. - ✅ [ ]( )
11. - ✅ [ ]( )
12. - ✅ [ ]( )
13. - ✅ [ ]( )
14. - ✅ [ ]( )
15. - ✅ [ ]( )
16. - ✅ [ ]( )
17. - ✅ [ ]( )
18. - ✅ [ ]( )
19. - ✅ [ ]( )
20. - ✅ [ ]( )
21





## ➤ Social
- [GitHub](https://github.com/bgoonz)
- [Gitlab](https://gitlab.com/bryan.guner.dev)
- [Bitbucket](https://bitbucket.org/bgoonz/)
- [code pen](https://codepen.io/bgoonz)
- [Glitch](https://glitch.com/@bgoonz)
- [Replit](https://repl.it/@bgoonz/)
- [Redit](https://www.reddit.com/user/bgoonz1)
- [runkit](https://runkit.com/bgoonz)
- [stack-exchange](https://meta.stackexchange.com/users/936785/bryan-guner)
- [Netlify](https://app.netlify.com/user/settings#profile)
-
# Child process | Node.js v15.12.0 Documentation
> Source Code: lib/child_process.js
**Source Code:** [lib/child\_process.js](https://github.com/nodejs/node/blob/v15.12.0/lib/child_process.js)
The `child_process` module provides the ability to spawn subprocesses in a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability is primarily provided by the [`child_process.spawn()`](#child_process_child_process_spawn_command_args
```
.php
.html
.txt
.htm
.aspx
.asp
.js
.css
.pgsql.txt
.mysql.txt
.pdf
.cgi
.inc
.gif
.jpg
.swf
.xml
.cfm
.xhtml
.wmv
.zip
.axd
.gz
.png
.doc
.shtml
.jsp
.ico
.exe
.csi
.inc.php
.config
.jpeg
.ashx
.log
.xls
.0
.old
.mp3
.com
.tar
.ini
.asa
.tgz
.PDF
.flv
.php3
.bak
.rar
.asmx
.xlsx
.page
.phtml
.dll
.JPG
.asax
.1
.msg
.pl
.GIF
.ZIP
.csv
.css.aspx
.2
.JPEG
.3
.ppt
.nsf
.Pdf
.Gif
.bmp
.sql
.Jpeg
.Jpg
.xml.gz
.Zip
.new
.avi
.psd
.rss
.5
.wav
.action
.db
.dat
.do
.xsl
.class
.mdb
.include
.12
.cs
# Simple Singly Linked List Implementation in Ruby
class Node
attr_accessor :value, :next_node
def initialize(value)
@value = value
end
end
class LinkedList
def initialize(value)
node = Node.new(value)
@head = node
@tail = node
end
def append(value)
@tail.next_node = Node.new(value)
@tail = @tail.next_node
end
def to_s(current_node=@head)
return current_node.value if current_node.next_node.nil?
return "#{current_node.value} > #{to_s(current_node
#SORTS
- Selection Sort: This algorithm works by examining a contiguous sublist of the original list. It finds the nth largest element in the list and swaps it with the nth element. It then examines n-1 terms. Selection sort runs in Θ(n2) time for worst, bets, and average case scenarios.
- Bubblesort: This algorithm works by swapping consecutive elements that are unordered. It ex- amines two consecutive elements at a time. Bubblesort terminates when it completes an iteration through the list wit
# Introduction to Ruby
## Why Learn Ruby?
* It has learned/stolen a ton from the languages that came before it.
* It's elegant and easy to learn
* It doesn't focus on making code as short as possible, it cares about readability
* It has a huge community behind it - documentation, tutorials, etc.
* RAILS!
Ruby is a well designed object oriented language. It is easy to read and stresses the DRY (Don't Repeat Yourself) principle. Since many of the method names and the ruby syntax itself is so mu
require 'nokogiri'
require 'rest-client'
class Review
attr_reader :raw, :date, :stars, :user, :body
def initialize(html='')
@raw = html
@noko = Nokogiri::HTML(html)
@date = extract_meta('datePublished')
@stars = extract_meta('ratingValue')
@user = extract_user
@body = extract_body
end
def five_star?
@stars.to_i == 5
end
private
def extract_content()
@noko.css('div.review-content')
end
<!DOCTYPE html>
<html>
<head>
<title>Example 9</title>
<style>
body {
margin: 0;
font: normal 12px/18px 'Helvetica', Arial, sans-serif;
background: #44accf;
}
/* Positioning Rules */
#container {
width: 900px;
margin: 0 auto;
}
#content {
position: relative;
padding: 20px 250px 60px 20px;
background: #fff;
}
#nav {
height: 50px;
background: #b7d84b;
}
#footer {
position: fixed;
bottom: 0;
width: 860px;
padding: 0 20px;
ba
# syntax = docker/dockerfile:1.0-experimental
FROM python:3.7-alpine AS builder
WORKDIR /app
COPY . .
# mount the secret in the correct location, then run pip install
RUN --mount=type=secret,id=pipconfig,dst=/etc/pip.conf \
pip install -r requirements.txt
EXPOSE 5000
CMD ["gunicorn", "-b=:5000", "app:app"]
const wait = (
time,
cancel = Promise.reject()
) => new Promise((resolve, reject) => {
const timer = setTimeout(resolve, time);
const noop = () => {};
cancel.then(() => {
clearTimeout(timer);
reject(new Error('Cancelled'));
}, noop);
});
const shouldCancel = Promise.resolve(); // Yes, cancel
// const shouldCancel = Promise.reject(); // No cancel
wait(2000, shouldCancel).then(
() => console.log('Hello!'),
(e) => console.log(e) // [Error: Cancelled]
);
**SYSTEMS**
<img src="docs/icons/windows.svg" alt="Windows icon" title="Windows">
<img src="docs/icons/powershell.svg" alt="Powershell icon" title="Powershell">
<img src="docs/icons/linux.svg" alt="Linux icon" title="Linux">
<img src="docs/icons/ubuntu.svg" alt="Ubuntu icon" title="Ubuntu">
<img src="docs/icons/gnubash.svg" alt="GNU Bash icon" title="GNU Bash">
<img src="docs/icons/ios.svg" alt="iOS icon" title="iOS">
<img src="docs/icons/android.svg" alt="Android icon" title="Android">
**B
1. [ Things you can do with gists ](https://www.labnol.org/internet/github-gist-tutorial/28499/)
2. [ Youtube fullstack MERN Deploy to Heroku ](https://www.youtube.com/watch?v=Z_D4w6HmT8k)
3. [ Firebase-Video ](https://fireship.io/lessons/firebase-quickstart/)
4. [ ]()
5. [ ]()
6. [ ]()
7. [ ]()
8. [ ]()
9. [ ]()
10. [ ]()
11. [ ]()
12. [ ]()
13. [ ]()
14. [ ]()
15. [ ]()
16. [ ]()
17. [ ]()
18. [ ]()
19. [ ]()
20. [ ](
class throttle(object):
"""
Decorator that prevents a function from being called more than once every
time period.
To create a function that cannot be called more than once a minute:
@throttle(minutes=1)
def my_fun():
pass
"""
def __init__(self, seconds):
self.throttle_period = seconds
self.time_of_last_call = time.time()
def __call__(self, fn):
@wraps(fn)
def wrapper(*args, **kwargs):
now = ti
Pipes---
1.Download the contents of "Harry Potter and the Goblet of fire" using the command line from here
wget https://raw.githubusercontent.com/bobdeng/owlreader/master/ERead/assets/books/Harry%20Potter%20and%20the%20Goblet%20of%20Fire.txt
1. Print the first three lines in the book
2.Print the last 10 lines in the book
3. How many times do the following words occur in the book?
4.Print lines from 100 through 200 in the book
5. How many unique words are present in the book?
Proces
# Docker Commands, Help & Tips
### Show commands & management commands
```
$ docker
```
### Docker version info
```
$ docker version
```
### Show info like number of containers, etc
```
$ docker info
```
# WORKING WITH CONTAINERS
### Create an run a container in foreground
```
$ docker container run -it -p 80:80 nginx
```
### Create an run a container in background
```
$ docker container run -d -p 80:80 nginx
```
### Shorthand
```
$ docker container run -d -p 80:80 nginx
```
### Na
## Photography
### CC0-license
All the resources below have specifically specified that their content is [:copyright: CC0-licensed](https://creativecommons.org/publicdomain/zero/1.0/).
* [ABSFreePic](http://absfreepic.com/) - A high-resolution and absolutely free photos stock site.
* [Altphotos](https://altphotos.com) - Handpicked free high-resolution photos added daily.
* [Barn Images](https://barnimages.com/) - Barn Images offers you a collection of free high-resolution non-stock photograph
1. [ WEB DEV RESOURCE HUB ](https://web-dev-resource-hub.netlify.app)
2. [ Data Structures Website ](https://trusting-dijkstra-4d3b17.netlify.app)
3. [Web-Dev-Quizzes](https://web-dev-interview-prep-quiz-website.netlify.app/intro-js2.html)
4. [ Recursion ](https://zen-lamport-5aab2c.netlify.app)
5. [React Documentation Site](https://csb-ov0d1-bgoonz.vercel.app/)
6. [ Blogs-from-webdevhub ](https://amazing-hodgkin-33aea6.netlify.app)
7. [ Realty Website Demo ](https://angry-fermat-dcf5dd.netlify.
/**************************************BIG-O***********************************/
/***********************Common Algorithms for Analysis********************/
//mdn Object;
//-**************-recursive factorial:*********************/
/*
Factorial: the product of a given positive integer multiplied by all lesser positive integers:
The quantity four factorial (4!) = 4 ⋅ 3 ⋅ 2 ⋅ 1 = 24.
Symbol:n!, where n is the given integer.
*/
function factorial(n) {
if (n === 1) return 1; //* Base Case ... 1
### Creating a clean gh-pages branch
This is the sequence of steps to follow to create a root `gh-pages` branch. It is based on a question at [SO]
``` {shell}
cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
git add .
git commit -a -m "First pages commit"
git push origin gh-pages
```
Why do we need to do all this, instead of just calling `git branch gh-pages`. Well, if you are at master and you do `git branch gh-pa
### Perf
- [ ] https://developers.google.com/web/fundamentals/performance/webpack/
- [ ] https://iamakulov.com/notes/resize-scroll/
- [ ] https://iamakulov.com/notes/optimize-images-webpack/
- [ ] https://developers.google.com/web/fundamentals/performance/webpack/decrease-frontend-size
- [ ] https://code.facebook.com/posts/557147474482256
- [ ] www.phpied.com/rendering-repaint-reflowrelayout-restyle
- [ ] https://blogs.windows.com/msedgedev/2017/03/08/scrolling-on-the-web/
- [ ] https://develope
// --------------------------- create basic server --------------------------- \\
const http = require("http");
let myServer = http.createServer(function (request, response) {
response.writeHead(200, {"Content-type": "text/html"});
response.write("<p><strong> hello </strong> batkan </p>");
response.end();
});
myServer.listen(3000);
-------------------------------------------------------
+ Guides
+ [Hack Design](http://hackdesign.org/courses/)
+ [Designer School](http://designer-school.com/)
+ [TheExpressiveWeb](http://beta.theexpressiveweb.com/)
+ [Talks To Help You Become A Better Front-End Engineer In 2013](http://www.smashingmagazine.com/2012/12/22/talks-to-help-you-become-a-better-front-end-engineer-in-2013/)
+ [Web Development Teaching Materials](http://www.teaching-materials.org/)
+ Architecture
// apply({}, [param1, param2, .., paramN]) sets the {} to be this on called function
// subsequent params are params!
// Very similar to call but params is an array
function printInfo(param1, param2) {
console.log(`This is my info: ${this.info}, and this is my param1: ${param1}, ${param2}`)
}
printInfo.apply({info: "frozenbananas are tasty"}, ["foo","bar"] )
{
"cells": [
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "players=(\"A\",\"B\",\"C\")",
"execution_count": 1,
"outputs": []
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "players",
"execution_count": 2,
"outputs": [
{
"output_type": "execute_result",
"execution_count": 2,
"data": {
"text/plain": "('A
Here is the list of the Popular Publication on Medium that could get your more views on your Medium articles;
The Startup
PS: I love You.
The Forge
The Mission
The Writing Cooperative
Better Marketing
Human Parts
Better Human
The Ascent
# Phresh 'n Clean
Wipe your hard drive clean and install your apps quickly.
[**Preparation**](https://github.com/naoki-evan-hisamoto/phresh-n-clean/blob/master/README.md#preparation) section will prevent you from losing important files, documents, and registration keys upon reinstallation.
[**Wipe + Reinstall**](https://github.com/naoki-evan-hisamoto/phresh-n-clean/blob/master/README.md#wipe--reinstall) section will walk you through installing a phresh copy of OSX.
[**Set Up**](https://githu
import React from 'react';
export const Circle = () => (
<svg height="{100}" width="{100}">
<circle
cx="{50}"
cy="{50}"
r="{40}"
stroke="black"
strokeWidth="{3}"
fill="red"
/>
</svg>
)
## PSQL
Magic words:
```bash
psql -U postgres
```
Some interesting flags (to see all, use `-h` or `--help` depending on your psql version):
- `-E`: will describe the underlaying queries of the `\` commands (cool for learning!)
- `-l`: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
Most `\d` commands support additional param of `__schema__.name__` and accept wildcards like `*.*`
- `\?`: Show help (list of availa
Gist
This is a quick tutorial explaining how to get a static website hosted on Heroku.
Why do this?
Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.
Basic Assumptions
You want to deploy some straight-up HTML, CSS, JS, maybe a few images. Nothing fancy here.
You are in the root directory of your site (i.e. the directory t
Gist
This is a quick tutorial explaining how to get a static website hosted on Heroku.
Why do this?
Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.
Basic Assumptions
You want to deploy some straight-up HTML, CSS, JS, maybe a few images. Nothing fancy here.
You are in the root directory of your site (i.e. the directory t
Gist
This is a quick tutorial explaining how to get a static website hosted on Heroku.
Why do this?
Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.
Basic Assumptions
You want to deploy some straight-up HTML, CSS, JS, maybe a few images. Nothing fancy here.
You are in the root directory of your site (i.e. the directory t
# Dad style programming jokes
> submit your own, if they make me laugh I'll merge them.
---
Unfortunately these jokes only work if you git them.
---
**Q:** Which body part does a programmer know best?
**A:** ARM
---
**Q:** Relationship status?
**A:** I'll leave the relations to the database.
---
**Q:** How do you get the code for the bank vault?
**A:** You checkout their branch.
---
**Q:** How did the developer announce their engagement?
**A:** They `return`ed `true`!
---
**Q:**
# Usefulness & Relevance:
>Does the content meet user needs, goals, and interests?
---
>Does the content meet business goals?
---
>For how long will the content be useful? When should it expire? Has its usefulness already expired?
---
>Is the content timely and relevant?
---
# Clarity & Accuracy:
---
Is the content understandable to customers?
---
Is the content organized logically & coherently?
---
Is the content correct?
---
Does the content contain factual error
# Full-stack Developer Interview Questions and Answers
## <a name='toc'>Table of Contents</a>
* [Architecture](#architecture)
* [Concurrency](#concurrency)
* [Java](#java)
* [General Questions](#general)
* [WEB](#web)
* [SQL](#sql)
* [NoSQL](#nosql)
* [Transactions](#transcations)
* [Scalability](#scalability)
* [Load balancing](#load-balancing)
* [Cloud computing](#cloud-computing)
* [Distributed](#distributed)
* [Cache](#cache)
* [Networking](#networking)
* [Ope
def fib_iter(n):
if n == 0:
return 0
if n == 1:
return 1
p0 = 0
p1 = 1
for i in range(n-1):
next_val = p0 + p1
p0 = p1
p1 = next_val
return next_val
for i in range(10):
print(f'{i}: {fib_iter(i)}')
/*------------------------------------------------------------------Fonts-----------------------------------------------------------------*/
/* latin */
@font-face {
font-family: 'charter';
font-weight: 400;
font-style: italic;
src: url('https://glyph.medium.com/font/81d2bf1/0-3j_4g_6bu_6c4_6c8_6c9_6cc_6cd_6ci_6cm/charter-400-italic.woff') format('woff');
unicode-range: U+0-7F, U+A0, U+200A, U+2014, U+2018, U+2019, U+201C, U+201D, U+2022, U+2026;
}
/* rest */
@font-face {
font-famil
//---------------------------------------Pseudo Code---------------------------------------------------------
// greedyalgorithm (array)
// let largest difference = 0
// let new difference = find next difference (array[n], array[n+1])
// largest difference = new difference if new difference is > largest difference
// repeat above two steps until all differences have been found
// return largest difference
//------------------------------------------------------------------------------
Here is a safe way:
grep -lrIZ foo . | xargs -0 rm -f --
-l prints file names of files matching the search pattern.
-r performs a recursive search for the pattern foo in the given directory .. If this doesn't work, try -R.
-I (capital i) causes binary files like PDFs to be skipped.
-Z ensures that file names are zero- (i.e., nul-)terminated so that a name containing white space does not get interpreted in the wrong way (i.e., as multiple names instead of one).
xargs -0 feeds the file names fro
/* -------------------------------------------------------------------------- */
// ------------------(Problem)----------------------------
/* -------------------------------------------------------------------------- */
/**
! Instructions
* 1) Run this code to observe its behaviour.
* The execution entry point is main().
* 2) Consider adding some additional tests in doTestsPass().
* 3) Implement countLengthOfCycle() correctly.
* 4) If time permits, try to improve your implementat
```bash
apt-mark showmanual
```
```
|01:19:09|bryan@LAPTOP-9LGJ3JGS:[~] ~_exitstatus:0__________________________________________________________o>
apt-mark showmanual
aptitude
automake
base-files
base-passwd
bash
bison
build-essential
checkinstall
cloud-init
cmdtest
curl
dash
dbus-x11
default-jre
detox
dict
diffutils
dnsutils
docker.io
dos2unix
e2fsprogs
eatmydata
enum
fdisk
fdupes
findutils
fontconfig-config
fonts-dejavu-core
git
gitsome
gnupg
grep
gzip
hostname
httrack
hugo
imagemagick
in
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally. Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.
A star (*) next to a name means that the command is disabled.
job_spec [&]
"""Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).
- A shallow copy constructs a new compound object and then (to the
extent possible)
// Device Checks
function isIE() {
return !+"\v1";
};
function isFF() {
return !!_V_.ua.match( "Firefox" )
}
function isIPad() {
return navigator.userAgent.match( /iPad/i ) !== null;
}
function isIPhone() {
return navigator.userAgent.match( /iPhone/i ) !== null;
}
function isIOS() {
return VideoJS.isIPhone() || VideoJS.isIPad();
}
function iOSVersion() {
const match = navigator.userAgent.match( /OS (\d+)_/i );
if ( match && match[ 1 ] ) {
/**
* Reads an ArrayBuffer as returns its contents as a binary string.
*
* @param {ArrayBuffer} buffer The buffer of data.
* @param {Function} callback Success callback passed the binary string.
* @param {Function=} opt_error Optional error callback if the read fails.
*/
function arrayBufferToBinaryString( buffer, callback, opt_errorCallback ) {
const reader = new FileReader();
reader.onload = e => {
callback( e.target.result );
};
reader.onerror = e
/**
* Creates a data: URL from string data.
*
* @param {string} str The content to encode the data: URL from.
* @param {string} contentType The mimetype of the data str represents.
* @param {bool=} opt_isBinary Whether the string data is a binary string
* (and therefore should be base64 encoded). True by default.
* @return {string} The created data: URL.
*/
strToDataURL( str, contentType, opt_isBinary ) {
const isBinary = opt_isBinary != undefined ? opt_isBina
{
"page": "worldwide.html",
"title": "Worldwide",
"users": [
{
"rank": 1,
"name": "Gleb Bahmutov",
"login": "bahmutov",
"avatarUrl": "https://avatars.githubusercontent.com/u/2212006?u=23b522c7384c4322687171ba919f2ed17b6fb0b4&v=4",
"contributions": 14020,
"company": "@cypress-io ",
"organizations": ""
},
{
"rank": 2,
"name": "迷渡",
"login": "justjavac",
"avatarUrl": "ht
## Table of Contents
* [Chapter 1 - Good Parts](#chapter1)
* [Chapter 2 - Grammar](#chapter2)
* [Chapter 3 - Objects](#chapter3)
* [Chapter 4 - Functions](#chapter4)
* [Chapter 5 - Inheritance](#chapter5)
* [Chapter 6 - Arrays](#chapter6)
* [Chapter 7 - Regular Expressions](#chapter7)
* [Chapter 8 - Methods](#chapter8)
* [Chapter 9 - Style](#chapter9)
* [Chapter 10 - Beautiful Features](#chapter10)
* [Appendix A - the Awful Parts](#AppendixA)
* [Appendix B - the Bad Parts](#AppendixB)
* [Append
## Installation
1. Install Postgres and a simple UI
```bash
brew install postgresql
# https://youtu.be/xaWlS9HtWYw?list=PL-osiE80TeTsKOdPrKeSOp4rN3mza8VHN&t=192
brew cask install psequel
```
2. Start Postgres
```bash
brew services start postgresql
```
3. Initialize the database
```bash
createdb sample_db
psql sample_db
```
## Creating the first table
https://youtu.be/w4HEVY_GjqY?list=PL-osiE80TeTsKOdPrKeSOp4rN3mza8VHN&t=317
[Postgres Data
### Read
* Data Structures and Algorithms in Python
* http://multimedia.ucc.ie/Public/training/cycle1/algorithms-in-python.pdf
* https://www.amazon.com/Structures-Algorithms-Python-Michael-Goodrich/dp/1118290275
* Clean Code: A Handbook of Agile Software Craftsmanship
* https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
* Code Complete: A Practical Handbook of Software Construction
* https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/073
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE
# Create a new directory and enter it
function md() {
mkdir -p "$@" && cd "$@"
}
# Use Git’s colored diff when available
hash git &>/dev/null
if [ $? -eq 0 ]; then
function diff() {
git diff --no-index --color-words "$@"
}
fi
# Create a data URL from an image (works for other file types too, if you tweak the Content-Type afterwards)
dataurl() {
echo "data:image/${1##*.};base64,$(openssl base64 -in "$1")" | tr -d '\n'
}
# Start an HTTP server from a directory, optionally specifying the p
# Easier navigation: .., ..., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Shortcuts
alias d="cd ~/Documents/Dropbox"
alias p="cd ~/Projects"
alias g="git"
alias v="vim"
alias m="mate ."
# List all files colorized in long format, including dot files
alias la="ls -Gla"
# List only directories
alias lsd='ls -l | grep "^d"'
# Always use color output for `ls`
if [[ "$OSTYPE" =~ ^darwin ]]; then
alias ls="command ls -G"
'use strict';
const childProcess = require('child_process');
const fs = require('fs');
const path = require('path');
function getFiles(cppDir) {
return fs
.readdirSync(cppDir)
.filter(function (item) {
const fullPath = path.join(cppDir, item);
return fs.lstatSync(fullPath).isDirectory();
})
.map(function (dirname) {
const fullPath = path.join(cppDir, dirname);
return fs
.readdirSync(fullPath)
A collection of awesome gists. Feel free to contribute.
## TOC
- [TOC](#toc)
- [Databases](#databases)
- [MySQL](#mysql)
- [Redis](#redis)
- [MongoDB](#mongodb)
- [DynamoDB](#dynamodb)
- [Services](#services)
- [Heroku](#heroku)
- [Amazon](#amazon)
- [Tsuru](#tsuru)
- [CloudFlare](#cloudflare)
- [Terminal](#terminal)
- [Tmux](#tmux)
- [Zsh](#zsh)
- [Testing](#testing)
- [YAML](#yaml)
- [JSON](#json)
- [Languages](#languages)
- [Python](#python)
# Remove python2
sudo apt purge -y python2.7-minimal
# You already have Python3 but
# don't care about the version
sudo ln -s /usr/bin/python3 /usr/bin/python
# Same for pip
sudo apt install -y python3-pip
sudo ln -s /usr/bin/pip3 /usr/bin/pip
# Confirm the new version of Python: 3
python --version
dataStructures();
function dataStructures () {
!( ( t, r ) => {
r.true = t, !( e => {
if ( "object" == typeof t && "undefined" != typeof module )
module.exports = e();
else if ( "function" == typeof define && define.amd )
define( [], e );
else {
let n;
"undefined" != typeof window ? n = window : "undefined" != typeof r ? n = r : "undefined" != typeof self && ( n = self ), n.algorithms = e();
}
} )( () => {
return function t
{
//---------------------------Extension descriptions----------------------\\
// - formulahendry.auto-close-tag: Automatically add HTML/XML close tag, same as Visual Studio IDE or Sublime Text
// - njpwerner.autodocstring: Automatically generates detailed docstrings for python functions
// - heyimfuzz.banner-comments: Converts selected lines into banner comments using figlet fonts.
// - HookyQR.beautify: Beautify code in place for VS Code
// - aaron-bond.better-comments: Improve
[good-hires](https://gistlog.co/bgoonz/15a638abb3b4026abc8e5ca05f8d90f1)
---
[public apis](https://gistlog.co/bgoonz/fb104c5834e2ce32778b162923ef68fd)
---
[ awesome crawler ]( https://gistlog.co/bgoonz/51714f703eba19ad65fb897068bc65c9 )
---
[ graphs in JS ]( https://gistlog.co/bgoonz/de05ada6da193c8a13bed59451290f0b )
---
[ regex ]( https://gistlog.co/bgoonz/03e15da8a9f4dd3c536e9fbbd9f380c7 )
---
[ git-resources ]( https://gis
# Hiring Without Hardship
A list of companies (or teams) that don't do "whiteboard" interviews. "Whiteboards" is used as a metaphor, and is a _symbol_ for the kinds of CS trivia questions that are associated with bad interview practices. Whiteboards are not bad – CS trivia questions are. Using sites like HackerRank/LeetCode _probably_ fall into a similar category.
The companies and teams listed here use interview techniques and questions that resemble day-to-day work. For example, pairing on a
## Index
* [Animals](#animals)
* [Anime](#anime)
* [Anti-Malware](#anti-malware)
* [Art & Design](#art--design)
* [Books](#books)
* [Business](#business)
* [Calendar](#calendar)
* [Cloud Storage & File Sharing](#cloud-storage--file-sharing)
* [Continuous Integration](#continuous-integration)
* [Cryptocurrency](#cryptocurrency)
* [Currency Exchange](#currency-exchange)
* [Data Validation](#data-validation)
* [Development](#development)
* [Dictionaries](#dictionaries)
* [Documents & Productivity
{
"application/1d-interleaved-parityfec": {
"source": "iana"
},
"application/3gpdash-qoe-report+xml": {
"source": "iana",
"charset": "UTF-8",
"compressible": true
},
"application/3gpp-ims+xml": {
"source": "iana",
"compressible": true
},
"application/a2l": {
"source": "iana"
},
"application/activemessage": {
"source": "iana"
},
"application/activity+json": {
"source": "iana",
"compressible": true
},
"application/alto-costmap+json"
#include <iostream>
using namespace std;
int main()
{
#include "m_pd.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define SIZE_ARRAY 200
#define TEST_SIZE 200
static t_class *dynamicTW_class; //handle for the class
float recording_array[SIZE_ARRAY] = {0};
int arr_position = SIZE_ARRAY - 1;
float saveValue = 0.0;
int triggerGlobal = 0;
/* struct to hold cost of arrival from left, bottom, and diagonal */
typedef struct _leftbottom{
float left;
float bottom;
fl
body {
background: linear-gradient(-45deg, #da0000, #0008ffe5, #23d5a2d8, #2f2fbce5);
background-size: 400% 400%;
-webkit-animation: gradient 15s ease infinite;
animation: gradient 15s ease infinite;
}
@-webkit-keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100%
[animated-background](https://jsanimate-gnj46.ondigitalocean.app)
# Awesome-crawler 
A collection of awesome web crawler,spider and resources in different languages.
## Contents
- [Python](#python)
- [Java](#java)
- [C#](#c)
- [JavaScript](#javascript)
- [PHP](#php)
- [C++](#c-1)
- [C](#c-2)
- [Ruby](#ruby)
- [R](#r)
- [Erlang](#erlang)
- [Perl](#perl)
- [Go](#go)
- [Scala](#scala)
## Python
* [Scrapy](https://github.com/scrapy/scrapy) - A fast h
_(scroll right on table to see all 5 columns)_
| Clone | Demo | Repo | Tech stack | Repo Stars
# Glow Text
-------------------------------------
A [Pen](https://codepen.io/bgoonz/pen/VwmRYWB) by [Bryan C Guner](https://codepen.io/bgoonz) on [CodePen](https://codepen.io).
[License](https://codepen.io/bgoonz/pen/VwmRYWB/license).
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title>Visualize data with rotation | Sample | ArcGIS API for JavaScript 4.18</title>
<style>
html,
body,
#viewDiv {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/light/main.css" />